subroutine

  1. B

    What happens from pressing a VBA userform button twice?

    So I am trying to understand what exactly happens if you press a VBA command button twice if it runs a subroutine. For instance does the first execution of the subroutine run by the button stop mid code and restart since the button was pressed again? I am trying to set up some ADO connection...
  2. D

    Run multiple subroutines to completion with one button click

    This is kind of complicated, so let me see if I can do it justice with an explanation that doesn't take 10 pages. I am working on a scheduling workbook for another department at our firm. They use it to keep track of what everyone in that department is projected to work on over the course of...
  3. M

    WorkSheet_Change for Multiple Sheets

    I have an extensive Worksheet_Change subroutine that works perfectly on Sheet6 where it is located. The routine is written so that everything accesses "activesheet" rather than the sheet name. I have parallel structures on Sheet3 and Sheet9 but they are not accessing the subroutine. I tried...
  4. Y

    Set pMod = ActiveSheet.PivotTableWizard failure

    Out of the blue......having used this piece of code in a pivot table creation subroutine for quite some time......."Set pMod = ActiveSheet.PivotTableWizard" throws an error: Run-time error Object variable or With block variable not set" This subroutine worked perfectly fine a month ago. And...
  5. M

    Application.OnTime Specifying both workbook and arguments

    Hi, I'm looking to run Application.OnTime and specify both the workbook and some arguments. I can get them to work on their own, but not together. For example, the following code works if "MacroToBeCalled" subroutine is in the same workbook where I set Application.OnTime. Application.OnTime...
  6. B

    Progress Bar

    I am creating a progress bar on my userform and was curious if there was a way to count the total number of lines of code within a subroutine for the vb editor and also find an exact line in vb editor where something is executed within a subroutine. If this is doable then I can create a pretty...
  7. J

    Function getting into my Subroutine.

    Hello guys, I have a little problem that I could find solution anywhere. and I bet it must be a simple one. I've created a few functions to deal with IPs. For example, I have in one cell the IP 172.21.103.166 and I want to add or subtract on the last octet (.166) what is been happening...
  8. S

    Need help programming a simple Excel database with VisualBasic

    Hello, I'm currently building a disciplinary report log for work. The design of the log is simple; I have a table in Sheet 1 with rows corresponding to employee names. Each column represents a general category of possible infractions (e.g. safety; cell phone usage; failure to comply with...
  9. G

    Closing one sub from another

    Hi all, I'm trying to create a button on a Userform that will not only close the userform (that part I've got down) but also end the subroutine running behind the Userform. There is a subroutine that calls the Userform that keeps running after the Userform is unloaded or hidden and I want...
  10. M

    Text in cells - how to break it up into X # of characters

    Good morning, I am currently workin with Excel 07 on windows XP Professional and i ran into an issue a couple of days back on a spreadsheet that contains mainly text responses inside of the cells. I am trying to create a subroutine that recognizes the cells that exceed an X number of...
  11. S

    Workbook_Open subroutine RUNS TWICE

    Hello all,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p> <o:p></o:p> i wrote some code that runs in the "Workbook_Open" subroutine.<o:p></o:p> My problem is that the "Workbook_Open" subroutine RUNS TWICE<o:p></o:p> When i open the excel file.<o:p></o:p>...
  12. M

    Create link (of some sort) to data which is filtered using VBA

    Hello, I am working with a worksheet with several tabs, for simplicity lets assume I have two, one with some aggregate figures (call it F) and one with all the data (call it D). Data in D is read in from CSV. Each figure in F represents a set of data from D, I want to make a link from a...
  13. A

    Please help me to start the subroutine

    Hello, I am a complete newbie on VBA, so please help me to start. Basically, I have to maximize ∑[θx* ln qx +(Ex-θx)* ln px] (where x is the subscript, denote the age) θx and Ex are known, I would like to model qx= Bc^x and px=(1-qx) I believe by using the VBA, subroutine function, I would...
  14. G

    referencing names of a checkbox in a sub or function

    Hi, Hoping someone can help here, Ive got quite a major hassle and been searching for an answer for some weeks, (it may be because I am using the wrong keywords so apologise if this is trivial)! I have 40 tests that are done on a piece of equipment, but not every test is done each time. I...
  15. G

    Linking subs

    Hi, I am teaching myself excel VBA and at present, everything I write, is done in one sub. There are certain sections of my code that I need to repeat several times in the sub. Is there a way I can put those lines in another sub (or area) which I could link into (and out of) each time I need...
  16. C

    Call Sub Routine

    I have a userform with a commandbutton that I would like to have call the same procedure whenever the commandbutton is pressed. I am using Excel 2003. The code for the command button is: Private Sub CommandButton16_Click() Sheets("Info").Select Call Fill UserForm1.Hide Application.Visible =...
  17. F

    Creating a patch in vba

    I have previously created a patch (with help from this forum) that allows you to choose a spreadsheet to open and then change details in the spreadsheet, save the changes and then close the spreadsheet. I am trying to use a similar patch and I can't get it to work. I can get the spreadsheet...
  18. R

    Working with popup boxes and VBA

    I have a macro that prompts for a password to unprotect a sheet and once entered, does a bunch more stuff. If the wrong password is entered is gives an error message and cancels the rest of the routine as it should. However, if I hit the 'cancel' button it goes on ahead with the routine which it...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top