variable

  1. M

    VBA to solve for equation based on missing variable

    Hi all, first post here. I've been learning VBA, and I've found the best way for me is to jump into exercises I've never done before. I recently came across a problem and decided to take a shot at it. I'm trying to use VBA to solve for the equation A = (B/C)^D, where any one variable A, B, C...
  2. E

    Find returning value not range

    Hello, I'm attempting to use a find function in my code. Yet, when I run it, it puts the value of the cell into the variable and not the range. Could someone please tell me what i am doing wrong? Sub Saving_Crack() Dim IDnum As String Dim filePath As String Dim crackIDnum As Range Dim wt...
  3. A

    Find two values, do something, then findnext instance of both, do some more things

    folks, i am working through a reformatting problem in another thread and came to a new problem along the way. Find and Findnext: in my active range, i set two variables to find. Set c = .Find("DEBT2.P33", LookIn:=xlValues) Set d = .Find("Previous Months Adjustments:", LookIn:=xlValues)...
  4. P

    VBA - How to call a new tab with variable name

    Hi, I've written some code in VBA which creates a new tab based on a cell value. As you can imagine this cell value can change. After creating this tab i wanted to paste some information into it. However, I cannot call the tab; i'm getting error 9 subscript out of range. Or Object required...
  5. B

    object variable or with block variable not set

    Good morning, I am a little bit lost here, the code was working fine, I don´t remember changing anything, and suddenly now is giving error. Already spend a few hours around this matter and I still don´t understand why is giving this error. Run-time error '91': Object variable or With...
  6. 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)...
  7. tbablue

    Passing a variable to a pivot filter.

    Hi Forum, Some help req'd with passing a variable to a pivot filter. How would I amend the following code such that PivotItems("99999") could be replaced by the value from a cell - a named range, [CandID_Picker]? The Pivot Table needs to filter on CandID_Picker - and nothing else. With...
  8. R

    Excel/VBA/Python - sharing variables/application.caller offset/read textbox

    I've been working with VBA and Python recently but I've never combined the two. I'm just trying to get my head around how the 2 communicate with each other. Is it possible to set a variable in VBA and then Python can read the value of the VBA variable? For example, if the VBA variable was from...
  9. D

    Variable in Ranges

    Among many inexplicable problems is this. I recorded a macro to sort a spreadsheet using Column A as the first key. The pertinent code that Excel generated is ActiveWorkbook.Worksheets("CurrentWines").Sort.SortFields.Add Key:=Range( _ "A2:A237"), SortOn:=xlSortOnValues...
  10. E

    Variable Range in VBA Regression

    Hello, I am trying to automate a linear regression but want it to work for variable sized data sets. This is what I have for a given set. The Y data always starts at X5 and the X data always starts at Y5, but the length of the column changes. Any ideas as to how I would allow for the regression...
  11. M

    VBA save a cell address(only number) as variable

    How can i save only the number of active cell address as a variable in vba code for example cell address is I$I4078 and in need 4078
  12. B

    Retrieving Variable dates from Filenames

    Hello all, Long time lurker, first time user.... So I am trying to retrieve dates from a lot of filenames. The dates and file names can be variable and I am at a loss... Ive been messing around with right() mid() Left() split(), but no luck... Here are a few examples for file names. text -...
  13. B

    Worksheet SelectionChange - Need value from previous cell (the one that was just changed)

    Hi, I've had a search but can't find a similar question. I am trying to get whatever a user has just typed into a cell and copy it to a different worksheet. I figured this was best to run in the SheetSelectionChange section, the idea being someone types something into cell B4 (or any cell)...
  14. F

    Minimum range of variable

    Hello, I have a "variable" (I think its called), called LastRow. And LastRow will find the latest row with data in special column. But if LastRow is empty. It will cause problems and delete information. Can I in some way set a minimum LastRow range? All help would be awesome! LastRow =...
  15. C

    Reference another page as variable in formula VBA

    Hi All, I'm trying to enter the formula =average($B$" & ProductRow & ":$KL$" & ProductRow & ") into cell "Cells(PivotRow, 3) onto my page "Pivot Data". My Line of code is the following Cells(PivotRow, 3).Formula = "=average($B$" & ProductRow & ":$KL$" & ProductRow & ")" This works except for...
  16. H

    Variable in Textbox Event

    I make a selection in a Userform.Listbox with data coming form the Textbox in a Userform Can I pass a variable to the Textbox Sub ..._Change event ie. Sub TextBx_Change(ByRef ....) I don't want to use a Public variable Thanks
  17. L

    Variable not defined error/ Command Button

    Happy Friday, I'm very familiar with excel, but not so much with VBA. I'm creating a form with drop downs and one "enter" button at the bottom. When I go to test I get a Variable not defined error with PrivateSub CommandButton1_Click() highlited in yellow along with the (x1Down). Help...
  18. S

    Excel VBA : Appending string with a variable

    Hi Friends, I have a string and a variable called "Formula". I want to append this string with my variable and update this value in the Cells(Lastrow, 3) of my active sheet. String is : “=IFERROR(IF(O9=” + Formula + " ;””);”Missing Leader Price”) " Note : Orange part is my string I tried...
  19. S

    Obtaining named cell from X # of workbooks in the same file path

    Let's see if I can articulate this and if someone can point me to the write thread. I wanted to see if I can do this on my own this weekend otherwise, I'll get our IT department involved (end of August). The purpose of this question is to see if I can pull the same named cell value from X...
  20. K

    Ubound Defined by Variable in Array

    I am trying to build this array that can be different for each set of data that is consantly growing. This means that I need to have a Ubound that is also growing. Unfortunately when trying to use the counter method to determine how big the Ubound should be everytime I kepp getting an error...

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