Simple Macro?

G

Guest

I would like to create a simple macro that

-starts at a cell of my choosing
-copies the formula there
-moves 12 columns across to the right and pastes that formula there
-copies the formula there
-moves 1 column across to the right and pastes that formula again
-copies the formula there
-moves 1 column across to the right and pastes that formula again

I tried to record something, but I cannot make it move across the same row...
 
G

Guest

Using Range.Offset(0,12) < moves 12 columns to you right

the above is out of context, and will probably not work if copied and
inserted into your macro

as eg you would be better of coding something like the following
'Pseudo Code
'Activate cell to copy
Worksheet.Range("YourCell").Activate
ActiveCell.copy
ActiveCell.offset(0,12).Paste

Personally I prefer to use
Dim rg as Range
Set rg = ThisWorkbook.WorkSheets(1).Range("YourCell")

With rg
..Copy
..Offset(0,12).Paste
..Offset(0,13).Paste
..OffSet(0,14).Paste
End With

HTH
 

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