var1

  1. R

    Accessing sub folders in a folder

    Hello everyone, I want to access all files available in a folder and its all sub folder. I have written VBA code shown below using file system object, but it is not working. Please check, what mistake is underlying. Sub checking_files_in_multiple_folders_and_subfolders(mainpath As String)...
  2. S

    [VBA] how to return nominal name (not content) of a variable?

    Sub Test() Var1 = 1 Var2 = 2 Msgbox VarName(Var1) Msgbox VarName(Var2) End Sub Function VarName() End Function Preferably, the above msgbox will result in pop-up window with "Var1" and "Var2", instead of 1, 2. Is it possible? Thanks a lot!
  3. M

    Conditional Variable for Pivot Table Filter

    Is it possible to make var1 in the following code conditional to its existence or not? Basically i'm trying to use a pivot table to help produce a report on attendees for each day of our event. var2 will always be a selection but var1 will eventually have Friday Only, Saturday Only, Sunday...
  4. M

    Macro to select multiple items in a pivot table

    Can someone help with the following code? At this moment in time I don't have anything that fits var1 and var3 but they will eventually come up. Is there a way to still have this code work but then have var1 and var3 not effect the pivot until there is data for that? Also is there a way...
  5. R

    VBA to variant returns string through iteration

    Hello guys, i am beating my head here need your help... i have 2 strings and i want a variant to call this string through an iteration, but i can't get it. Sub teste() Dim i As Integer For i = 1 To 2 var1 = "Empresa" var2 = "Material" desc = "var" & i l = Application.Match(desc...
  6. James_Latimer

    MMULT in VBA - 1004 error

    Excel 2016 I was hoping someone could give me some pointers please, i'm having some issues with the following and can't quite understand why. I have the following code Dim var1 as Variant, var2 as Variant var1 = Sheets("Sheet1").Range("R16:AC16") var2 = Sheets("Sheet2").Range("P4:P15")...
  7. Seba Robles

    VBA: Variable to reference cell value, run code, then reference cell below

    Hello everyone, so here's the information on my workbook and code; - I have 2 worksheets; Sheet1 where I have a range of values in column A and Sheet2 where my code runs Here's part of my code Dim c As Integer c = Worksheets("Sheet1").Cells(16, "A").Value Sheets("Sheet2").Select Rows(c &...
  8. A

    How to refer to multiple variables

    I am trying to select a range of rows, then hide or unhide them. here is some sample code: Dim Var1 as range Dim Var2 as range Set Var1 = Sheets("Sample").Range("22:25") Set Var2 = Sheets("Sample").Range("28:33") Range("Var1,Var2").EntireRow.Hidden = True (this is the error line) I get an...
  9. L

    Converting Excel Countif to VBA Code

    Hi, I need your help with converting my formula into VBA Code.Please can you help me with this code, it spring a runtime error on line 2. Why? Excel:Formula =IF(COUNTIFS(F3:F10,"NONE_TP")=0,"",(COUNTIFS(F3:F10,"NONE_TP"))) Sub TestPhase2 Dim ws As Worksheets<o:p></o:p> Dim lr As...
  10. R

    convert a formula R1C1 to formula of A1 format

    How can I convert a formula R1C1 to formula of A1 format. I have a formula as: Worksheets("View Data").Range("D2").FormulaR1C1 = "=MID(Data!RC[" & Var1 & "],(LEN(Data!RC[" & Var1 & "])-9),9)" to Worksheets("View Data").Range("D2").Formula = "=MID(Data!F2,(LEN(Data!F2)-9),9)" the column F...

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