Copy macro changing cell reference

M

Mike

Novice level user of Excel 2003. I have a macro I want to copy down
hundereds of rows. When I copy and paste the button assigned to a macro it
copies but the macro runs for the first row. I need the macro to run for the
row the button is clicked on. Info as follows:

Sub CheckedLater()
'
' CheckedLater Macro
' Macro recorded 12/12/2008 by
'

'
Range("A6:K6").Select
With Selection.Interior
.ColorIndex = 41
.Pattern = xlSolid
End With
Selection.Interior.ColorIndex = 33
Range("A6").Select
End Sub

....so if I copy the button down to row 7, I would like the range to reflect
A7:K7.

Any help would be greatly appreciated.
 
D

Don Guillett

Assign to ONE button. Never use a button or shape for each row.....

Sub checkedlater1()
Range(Cells(ActiveCell.Row, 1), Cells(ActiveCell.Row, 6)) _
.Interior.ColorIndex =
33
End Sub
 
M

Mike

Thank you very much for helping. When I enter the info exactly as I have it
below, it gives me compile errors.

Range(Cells(ActiveCell.Row, 1), Cells(ActiveCell.Row, 6))
_.Interior.ColorIndex = 33

Am I putting it in wrong?
 
D

Don Guillett

When you enter it where???? This is a sub that will, when you click the
button/shape assigned will color col a-e light blue.. I thought that's what
you wanted. It may be better to send your file to my address below along
with a clear explanation of what you want and before/after examples.
 

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

Top