Mark active row in column A (VB question)

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

Hi,

Can someone please help me with the VB code to put an X or an asterisk in
column A to indicate the activerow?

I'm running Excel 2003 from work and cannot utilize any downloaded add-ons.
I found several helpful posts instructing OP's how to highlight the entire
row using VB, in my case I just need a distinct mark in column A.

Thanks in advance,

Ben
 
hi
not sure if i understand fully your request.
what constitutes the activerow? the row with the cursor in it?

Range("A" & Activecell.row).value = "X"

this will put an X in column A of the row the cursor in it.

Regards
FSt1
 
Thanks for the rapid response FSt1. You did understand my request but I have
a problem with your solution, hopefully you can help.

I added the following to your code and added it as a Worksheet Event:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A" & ActiveCell.row).Value = "*"
End Sub

The "X" appears in column A but doesn't disappear when I click on a new row
(in other words if I click up and down my worksheet, I paint X's in every row
of column A). Can you please help me to make them disappear when I click on a
new row (and appear on the new row)?

Thanks again,

Ben
 
hi,
is column a empty except for the *??
if so then....
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A:A").ClearContents
Range("A" & ActiveCell.Row).Value = "*"
End Sub

regards
FSt1
 
Works perfectly, thanks for the help!

FSt1 said:
hi,
is column a empty except for the *??
if so then....
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A:A").ClearContents
Range("A" & ActiveCell.Row).Value = "*"
End Sub

regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top