Link to home
Start Free TrialLog in
Avatar of itsmevic
itsmevicFlag for United States of America

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.Address
'Step 3: Pass the range string to a Range
Range(strRange).Select
End Sub
ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of itsmevic

ASKER

Works like a charm!  Thank you so much!