passing variables

  1. G

    Bug with passing variables between user forms--VBA

    I have a userform (frmMatrix) where the user enters the current Heat Index and Population of Interest and is returned with a statement of recommended protective measures. Next, they are asked if they would like to make a record of these protective measures in my Data Entry form (frmForm). Upon...
  2. J

    Using a variable inside a worksheetfunction

    I am trying to pass a variable into a function and it will not accept it. What is the syntax that I am missing to get it to use the variable in the worksheet function. Thanks in advanced I have been banging my head against for countless hours! Dim VARADD As String Dim VARSUM As String X = 0 Do...
  3. V

    Referring to variable present in macro from another workbook

    Hello, I want to get value of variable from macro which is present in another workbook. I tried below code. errmsg = errmsg & Application.Run("'" & filename & "'!appending_data").errm & vbnextline Obviously I messed with syntax. I am not into coding. Could you please help me with the same.
  4. E

    Passing Variables through Loops

    Can a subroutine both pass and call up variables? I am attempting a complex numerical iteration program that requires subroutines to both pass and call up variables. If it can't be done, is this a reason why I should switch to a Gnu Octave or Matlab program? Because my program is very...
  5. E

    Passing Global Variables by Value

    I want to create public variables, but always want to pass the current value of the variable from one procedure to another. For Example: ------------------- Option Explicit Public X as Long Public Y as Long Public Z as Long Sub A () X = 1 Y= 2 Z = X + Y Call B Worksheets...
  6. N

    Grabbing working directory and passing it as variable in macro

    I am trying to figure out how to grab the working directory and pass it as a variable via a macro. I am running a python script from a directory that is captured with user input and will always have a results subfolder. In the python script I am running Macro1 from an Excel template that is...
  7. D

    Trouble with UserForms and Variables

    Hi all, I new to the site and still a bit new to VBA. What I am trying to do is open a user form and allow the user to pick a file (perhaps a few files in the future) open it and display the file name with one button click. Then use another control bottun to do the work of getting the needed...
  8. U

    How can I pass an Array so I can get the verable count?

    I have a routine that counts variables but I have to pass a string so it knows which one to test. There has to be a better way. Private Function ArrayVariableCount(Arr As String) Dim nonEmptyElements As Integer, i As Integer ' nonEmptyElements = 0: i = 0...
  9. A

    Passing Arrays Between Subs

    I know I am doing this wrong but I what I am trying to do is pass an array from boxSelect_Change to subBox_Change. Then I want to reference that array inside subBox_Change. Is there even a way to do this? Here is my attempt: Private Sub boxSelect_Change() If boxSelect.Value <> "" Then...
  10. JackDanIce

    Passing variables between code?

    Hi, I have an event trigger in my workbook (that monitors report delivery deadlines) that when the workbook is opened, it cycles through some defined sheets and alerts the user if a report is due that day. I'm in the seperate process of creating a module that will email a manager if a...
  11. E

    Calling Procedures in Another Workbook and Passing Variables

    Hello- I have a VBA Routine where I open workbook and run some code in the newly opened workbook that requires two input parameters...I've been trying to pass them ByVal however the debugger now does not recognize the Call to the procedure if I include the variables...anybody have any ideas on...
  12. R

    Passing Variables

    Please let me know how I can pass a variable from my double click code to my user form code. Here's what I have done and it does not work... In Sheet1-- Public TestTarget As Integer Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim FileToOpen As...

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