call a sub

  1. K

    Select the Name in the Data Validation list on a cell value then the same name run the sub macro

    Excel VBA code is required to Select the Name in the Data Validation list on a cell value after the same name could be run in the sub macro. E.g. Data Validation List assigned in "Sheet3" cell text value "B2". if I select the "AA" and then Call to "AA" Sub Marco run. I got error the code line...
  2. Gideon du Toit

    Simple Sub Procedure Call not running

    I am busy on a VBA/ Excel project. Most of everything runs fine and I can step through the code as I debug. However, in the one click event, I call a sub named, Get_Consult. For some reason, this sub refuses to run. I added breaks inside the sub to step through the code, but although the call to...
  3. larinda4

    Msg box with 3 options - Call A Sub

    Good morning, I have three separate VBA codes and I want it to run a specific sub depending on the option selected from a MSG box? My three options for the msg box: - WI - WI, H&D - H&D The user will select which one and then I want it to call the sub depending on the selection. Can this be...
  4. S

    Calling new Subs

    Hello, So, with help of kind people here I was able to make most of my project work, but have hit the hopefully last bump. Basically, I have a worksheet that based on condition decides whether the issue should go after Quality, Logistics or Finances, and then generates an email to be just sent...
  5. C

    Passing Variables between Macros

    Hi Guys, Unsure if you are able to do this. Example 1. Macro - Sub Test 2. Macro - Sub Test2 Within macro "Test " I'm calling macro "Test2" and passing a variable. The called macro "Test2" does what it needs to do and once completed I need to pass variables back to the main macro "Test"...
  6. A

    Only first Call method is being executed when module is ran.

    Hi, I have module1 which when ran is supposed to: Set variable "template" Call 6 different Sub's with "template" as argument The 6 subs all work perfectly when ran individually but when I try to use the Call method to run them only the first one gets ran, the other 5 never get executed. All...
  7. M

    Call with identifier populated from worksheet value using VBA

    I have been trying to use a Call with a variable to access other functions in Excel vba. I can access the cell contents but cannot assign it. The compiler states an error "Expected: identifier". Any ideas or thoughts? Do While j < numberOfSections + 1 functionCall =...
  8. S

    Trying to use "Call" to make a jump to 2nd subroutine but it always gives me errors

    I'm trying to use subroutine for Beforedoubleclick for all available sheets regardless of name or number and (Call Worksheet_BeforeDoubleClick) is giving me various kind of error and won't go to that subroutine. Please assist. Here's my code Sub Dosomething() Dim pSheet As Worksheet...
  9. E

    Clear cell after 60 seconds vba

    Hi all, I want to clear cell "I15" after 60 seconds. I will be calling this sub within another sub. Probably being stupid but can someone see why the following isn't working? The cell is being cleared instantly. Sub ClearTimer() Dim StartTime As Single StartTime = Timer Do While Timer -...
  10. M

    Call Sub, if there is a Value in a cell

    Hi everyone, I want to call a Sub, if there is change in a certain cell. With the following code, this works as lang as there is something in the cell. [CODE] Private Sub Worksheet_Change(ByVal Target As Range) If Target = Range("A1") Or Target = Range("A2") Then Call "Name of Sub" End...
  11. B

    How do I assign string variable values across multiple subs and modules once?

    Scenario: I have 3 subs inModule 1. Each one of thesesubs uses some but not all of 5 available variables. All Strings. Instead of pickingand choosing which variables to define in each of the 3 subs, I'd like tocreate 1 more sub in Module 2. This sub would be called at the start of each ofthe 3...
  12. G

    How do I assign string variable values across multiple subs and modules once?

    Scenario: I have 3 subs inModule 1. Each one of thesesubs uses some but not all of 5 available variables. All Strings. Instead of pickingand choosing which variables to define in each of the 3 subs, I'd like tocreate 1 more sub in Module 2. This sub would be called at the start of each ofthe 3...
  13. S

    End sub creates "Runtime Error 91: Object variable or with block variable not set"

    Apparently this happens when a variable is not defined, but all mine are, as far as I can tell. Also, when debugging, the error appears on the End Sub line. That is, the macro (seems to) exit correctly, but as it exits I get the error msg. If the error box could be forced to not appear it would...
  14. C

    Run Time Error 1004 AutoFilter method of Range class Failed

    Hi All I hope you can help. I am getting the error Run Time Error 1004 AutoFilter method of Range class Failed When I run my code, the funny thing is It works perfectly by itself, but when I put it into the other code and call it, it gives the error Run Time Error 1004 AutoFilter method of...
  15. L

    Combine code?

    Hello, I am trying to copy the source data into all reports file located in my folder and it is working as i expected. However, i have to choose the same source file every time the loop go through one excel report in the folder. Would someone please help me to modify the code so that i only...
  16. J

    Code working by itself, BUT not when "call"ed by another code

    Hi all - I have been recieving some help pertaining to finding empty rows. I got the code to work: Dim nLastrow, bFind As Range Dim ii As Integer For ii = 2 To 5 nLastrow = Cells(Rows.Count, 3).End(xlUp).Row Set bFind = ActiveSheet.Range("C5:" & "C" & nLastrow).Find(What:="B" & ii...
  17. D

    Problem Calling A Sub When Using Worksheet_Change

    Hi Everyone, I'm trying to call a sub called ScaleAxes that sits in a module elsewhere. The ScaleAxes code is: Option Explicit Sub ScaleAxes() Worksheets("Dashboard").ChartObjects("Measure Chart").Activate With ActiveChart.Axes(xlCategory, xlPrimary) .MaximumScale = Sheets("Lists and...
  18. J

    VBA call a macro during a active x button

    I have a command button macro that is set up. in it i call a Sub from the workbook. When i run the macro by itself, it works just fine. The command button works just fine by itself as well, but once they are combined it ends up giving me an error. "Run-time error '9': Subscript out of range" the...
  19. C

    Sub called from another workbook (Insert new line)

    Hi everyone, I'm trying to call in the parent Workbook (test) a sub in another Workbook (test2). This sub is supposed to insert a new line the test2. That is where the code is originally located. If I run the code seperately it works fine. If I try to call it from test, it doesn't. Do you have...
  20. T

    Macro to combine multiple worksheets into a summary workbook without merging the worksheets

    I am trying to figure out how to combine 2 macros. The first macro allows me to select the file path I need, and the second macro will use the file path from the first macro and pull the worksheets from all files in the file path and combine them into 1 summary workbook. What is the best way to...

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