Macro range cell

G

Guest

I recorded the macro below.
Works fine only i have to stand on the cell in Column O.
I want that the macro always start in Column O no matter wich cell
i have selected in that row.

Sub Macro2()
'
' Selection.Copy
ActiveCell.Offset(0, -2).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(0, 1).Range("A1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "0"
ActiveCell.Offset(0, 1).Range("A1").Select
End Sub
 
B

Bob Phillips

Sub Macro2()

Cells(ActiveCell.Row, "O").Offset(0, -2).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, _
nOperation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
ActiveCell.Offset(0, 1).Range("A1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "0"
ActiveCell.Offset(0, 1).Range("A1").Select
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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