itsmevic
asked on
Excel 2010: VBA Question. Unable to Run Macro.
Hello Experts -
I have a macro that I'd like to run. All this macro does is simply highlight the row and column you are on for easy viewing. After I save the code and go back to the worksheet to use it's not working. Is there something wonky with my code?
My worksheet is named "test", and I have placed a module underneath it that contains the below code:
Private Sub test(byVal Target As Range, Cancel As Boolean)
'Step 1: Declare Variables
Dim strRange As String
strRange = Target.Cells.Address & "," & _
Target.Cells.EntireColumn. Address & "," & _
Target.Cells.EntireRow.Add ress
'Step 3: Pass the range string to a Range
Range(strRange).Select
End Sub
I have a macro that I'd like to run. All this macro does is simply highlight the row and column you are on for easy viewing. After I save the code and go back to the worksheet to use it's not working. Is there something wonky with my code?
My worksheet is named "test", and I have placed a module underneath it that contains the below code:
Private Sub test(byVal Target As Range, Cancel As Boolean)
'Step 1: Declare Variables
Dim strRange As String
strRange = Target.Cells.Address & "," & _
Target.Cells.EntireColumn.
Target.Cells.EntireRow.Add
'Step 3: Pass the range string to a Range
Range(strRange).Select
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER