explicit

  1. M

    Error Handling

    Hoping somebody can help, I'm a rookie in VBA (but learning). I have the piece of code below and had 2 questions. 1. I would like to add code so that if the Path isn't available the spreadsheet doesn't give the user an error upon opening. This could happen if the user moves the file from the...
  2. R

    VBA Beginner

    I am working through EXCEL VBA Programming for Dummies from 2004. I am getting the "Compile error: Variable not defined" pop-up. Below is what my code looks like and it is verbatim as the example in the book. I know the problem has something to do with the "Option Explicit" at the top and...
  3. R

    make x as variable

    Hello Excel Gurus, Simple question: is it possible to make x variable using the function above? or anything text or numbers that I want to declare. not working code Option Explicit Sub test() Dim x As String Debug.Print Evaluate("=CELL(""format"",x)") End Sub working code Option...
  4. J

    Option Explicit causing compile error

    This code is periodically crashing excel when a user doesn't save a workbook. Sub FillLog(uName) Option Explicit uName = Environ("UserName") Sheets("Values").Cells(10, 43) = uName End Sub I ran the "Compile VBA Project" from the debug menu and it gave me an error or "invalid inside...
  5. T

    Default property of Target

    I have this code which activates when a cell on Sheet1 is changed. Suppose I double-clicked cell A1. Hovering the mouse over Target shows $A$1, as expected and the code runs through to teh function, without any problems. Option Explicit Private Sub Worksheet_Change(ByVal Target As...
  6. J

    VBA macro to auto hide rows and columns with no value

    Apologies if this has already been posted, I'm new to this forum but I have had a search but couldn't find anything specific enough. I have found a code for hiding rows which works well and I've tried to adapt it to work for columns too. This is what I have tried: Option Explicit Private Sub...
  7. M

    For...Next Statement vba

    I'm using MS Office 2010. win7 Somehow I've gotten the selected new rows to focus rather than the most recent one. I need to use FOR Loop to find and select only the last row. so how would i put it in For...Next Statementthis what i have so far: Option Explicit Private Sub...
  8. F

    Need VBA to copy active row and paste it in last row of another sheet

    Need macro to copy active row and paste it in xfiles-xsheets-lastrow. With same format and everything. I've tried this : <code>Option Explicit Sub copypasterow() Dim wbTarget As Workbook Selection.EntireRow.Copy Set wbTarget =...
  9. T

    I need this macro todo what it does but exclude the name range "Control1"

    Hi Everyone, I have this macro that removes all name ranges from a document, it works great but I would like to keep one called "Control1" can anyone edit it so "Control1" is not removed Thanks Tony Option Explicit Sub RemNamedRanges() Dim nm As Name...

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