Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When you record macros you will see selections all over the place. That is
because you are recording your actions and you are making selections. But there is almost no need for a macro to do any selecting. You can refer directly to workbooks, sheets and ranges. That makes your macros shorter faster and less prone to failure. -- HTH... Jim Thomlinson "uturnabout" wrote: Thanks Jim, That one works. I thought the act of copying would change the selection. kudos for deciphering my imprecise question. "Jim Thomlinson" wrote: You can do it in 1 macro. Actually you can do it with one line of code... Range("A1:A10").Copy Destination:= Activecell.offset(0,2) Change the A1:A10 to suit. -- HTH... Jim Thomlinson "uturnabout" wrote: 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? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro using relative references | Excel Worksheet Functions | |||
Relative references and macro programming | Excel Programming | |||
macro vba relative references | Excel Worksheet Functions | |||
relative cell references in vba macro | Excel Programming | |||
Making a macro references relative | Excel Programming |