1. T

    Passing arguments in a loop

    Instead of writing this: Option Explicit Sub Calling() Call Module1.Called(somearg:=1) Call Module1.Called(somearg:=2) Call Module1.Called(somearg:=3) End Sub Sub Called(ByRef somearg As Integer) somearg = somearg + 1 End Sub I would like to use...
  2. mole999

    Sub is this possible

    I'm having a big problem with a set of routines (I won't explain them) Is it possible to call a routine from a Sub, and return the ID of the calling Sub (maybe its not worth doing) I want to list each sub entry and a time stamp to be able to focus down on what the issue is Sub One Reporting End...
  3. B

    Calling a Sub within the Main Macro

    I am having issues with this string of code: Sub Format_Workbook_Pt2() Sub ConvertTextToNumber() Sheets("All_Data").Select Range("C:C").Select Selection.TextToColumns _ Destination:=Range("A:A"), _ DataType:=xlDelimited End Sub End Sub I...
  4. G

    How to detect Userform 'X' or Cancel click from sub that loaded it

    I have a Sub that loads a userform I created. In the sub, I change a label caption in the form and reuse it using a loop to capture the user's option selection for each new context (but with the same options presented). Load frmExample With ActiveSheet For x = 1 To UBound(vValue)...
  5. L

    VBA - How to get the serial number of UNC Drive Without API calling

    Guys For security reasons I want that my workbook can only be used if it is on a network. This network sometimes is mapped by user with different Letters. I would like to find a way to get the serial number of the network drive based on the UNC path instead of Drive Letter. But I would like to...
  6. R

    New version keeps calling up old version

    Hi folks, OK, got myself in a jam again. :confused: In a major re-building of my project (to make use of stuff I learned here :)), I did a lot of copy/pasting procedures from the old version to the new. Obviously I did something wrong, because the new version keeps calling up (or trying to...
  7. S

    Download error checker

    I have a macro that runs/calls 10 other macros that download pdfs from specified URLs online. these aren't big files... like 5-8mb BUT these are coming via a VERY SLOW satellite link... so if I download 10 pdfs via 11 macros (1 macro that calls each of the 10), is there a way/a macro/piece of...
  8. T

    Passing argument via the calling procedure

    Looking at this: in particular this code: CBTProc = CallNextHookEx _ (lCBTHook, idHook, ByVal wParam, ByVal lParam) What is the significance of adding ByVal? My understanding...
  9. R

    Fill Multiple Cells With Different Header Data

    Have an extracted text file that was imported into Excel. This is the exact format subsequent to import: <tbody> RVICE TY PE : TP SU SP ENSE TYPE : I AA REASON : Invalid Service Traffic Stream T139914 1/12/2016 9:53 I 5578457844 7878515342 ST LUCIA 20:00 TP DD C8 I= O=...
  10. S

    deleting OLE control from inactive worksheet

    Dear Mr.Excel, Happy Holidays; In my Add-In I monitor the SheetActivate event, and create an OLE control by calling active sheet's .OLEObjects.Add() method. When the sheet de-activates its SheetDeactivate event is fired and I need to delete the control by calling its .Delete() member. Excel is...
  11. M

    Function is changing a variable in the calling subroutine

    Hi, I am noticing an unusual behavior that a called function changes a variable of the calling subroutine. As shown below, subroutine Change_rows() is calling Clean_formula(). What I am noticing is that when the control comes back to Change_rows() the value in formula1 is the same as that in...
  12. S

    Suppress displayalerts when calling procedure in another workbook

    Hi all, I am calling a procedure in another workbook with VBA. The workbook is already open. I am trying to suppress all alerts with application.displayalerts = False. I added the application.displayalerts in both procedures. But after calling the procedure in the other workbook I am still...
  13. Mackeral

    Why is this Variable

    I have this codeRow_Id = "0a" Call Parse_Line(Prog, 0, Line, Orig_Code, Calling, Row_Id) which calls this function with a line of code in it:Function Parse_Line(Prog, Lvl, Code, Orig_Code, Calling, Row_Id) As Boolean Flag = Parse_Expression(Prog, Lvl, Code, Orig_Code, Calling, Row_Id)...
  14. S

    ThisWorkbook Open Script not functioning

    I have a workbook that works when ran from a button added to one of the sheets calling a Macro called Monster. In the Private Sub Workbook_Open() I have it calling the same function, but it does not handle to code properly.
  15. C

    1004 Error calling Macro from another Workbook---only on some

    Hey all, having a very irritating error that I can't get resolved...I am opening and calling the same Function name from 6 workbooks. 4 of them it works perfecly fine. The other 2, I get the dreaded "Error 1004 The macro cannot be ran or macros are disabled". Everything is right. The...
  16. A

    VBA calling a bat file not working on different workstation

    Hi there, I wrote a macro which is creating a bat file with values from excel cells and calling it as well. The excel and bat file are placed on a network server. Everything is working perfectly(writing the bat file, calling it, running the commands in cmd) when I run it from my workstation...
  17. J

    sub is getting ignored from call subs

    Sub savereport() Application.DisplayAlerts = False Application.ScreenUpdating = False ChDrive Left(ActiveWorkbook.Path, 2) ChDir ActiveWorkbook.Path SaveAsName = Application.GetSaveAsFilename(FileFilter:="Excel Files (*.xlsx), *.xlsx") If SaveAsName <> False Then...
  18. E

    Change a section of code when calling it

    Hi I have a simple code i want to call in several occasions. Is it possible to change "qwr" when calling it? ActiveSheet.ListObjects(1).ListColumns("qwr").DataBodyRange.ClearContents Cheers!
  19. R

    Call a Macro from another WB - Run-time Error '1004'

    Hi everyone, I have written several macros to grab data from an external source and copy it to the open workbook but occasionally the exact same codes runs into the Run-time Error 1004. The setup is I have around 20 Workbooks each which have the below code within them referring to a single...
  20. S

    Vba syntax question: Passing variables into Function, returning array of longs

    Something like... dim retArray (0 to 1) as Long reDim retArray ( 0 to 1) retArray = doSomething(wSheet, searchVal, rngStart, rngEnd) ( Function doSomething(w, srch, begin, end) () retArray(0) = 100,000 retArray(1) = 5 doSomething = retArray End function The psuedo-code...

Watch MrExcel Video

This Week's Hot Topics

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
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 "".
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