View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones[_2_] Norman Jones[_2_] is offline
external usenet poster
 
Posts: 421
Default Fixed and Relative Macro References

Hi Uturnabout,

Try:

'<<========
Public Sub Tester()
With Selection
.Copy
ActiveSheet.Paste Destination:=.Offset(0, 2)
Application.CutCopyMode = False
End With
End Sub
'<<========

or:

'<<========
Public Sub Tester()

With Selection
.Copy Destination:=.Offset(0, 2)
End With

End Sub
'<<========



---
Regards.
Norman



"uturnabout" wrote in message
...
I am trying to learn about what macros can and can't do.

Essentially, I want to copy data from a fixed location and paste it in a
relative location. It seems like this should be possible, but no matter
what
I try, it fails.

Most recently, I have tried to use two separate macros.
Macro 1 selects and copies the fixed data.

Selection.Copy

Macro 2 should paste two spaces to the right of where the cursor is.

ActiveCell.Offset(0, 2).Range("A1").Select
ActiveSheet.Paste

I have recorded these macros, but when I try to run Macro 2, I get an
error
(either 1004 or 438 if that is relevant)

Is what I am trying to do possible?