call a sub

  1. 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...
  2. 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 =...
  3. 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...
  4. 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 -...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. 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...
  14. 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...
  15. 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...
  16. novel

    Multiple Calls and Performance

    I am writing a sub that has 17 calls to different subs and functions. I broke it up in this way because it was easier to write smaller pieces since a lot of actions are repeated (e.g., copying and renaming worksheets) and it was easier to control the flow I diagrammed in advance. Some calls are...

Some videos you may like

This Week's Hot Topics

  • Use Filter function with 2 criteria to return a specific value
    I've spent many hours trying to find out why the basic formula for Filter function with 2 criteria will not return a value other than #CALC. I'm...
  • Loop stopping at row 10
    Below is a code I had a lot of help with from user such as yourself. This code worked well but now is stopping a row 10 and I can't see why! Could...
  • Numerical Order Code for Macro
    I am trying to find a code or fix what i have on the macro that will automatically make the certain column generate in numerical order when I...
  • Calculate time in excel
    I get a text report from our time keeping system that i dump into excel through a data connection and I need to calculate the total hours for a...
  • VBA
    Hello everyone, I need your help please. I just need VBA code to get my reports working. What I want to do is whenever these dropdowns are...
  • Help with formula to sum numbers prior to date
    Hello, I was hoping to get some assistance as I'm having trouble with this. Using my table below as an example, how could I write a formula which...

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
Top