repeat recording

jerryo1314

Board Regular
Joined
Nov 9, 2002
Messages
50
Hi,
I recorded a macro now I want it to move down to the next cell so I can repeat it using ctrl z again.
Jerry
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
jerryo1314,

If you post your code and explain what it should do, I bet some of the code gurus here can make it work better than you ever dreamed.

Dufus
 
Upvote 0
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 9/24/2006 by Jerry O
'

'
Range("S103:AG103").Select
Selection.Copy
Range("S104").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=False
Range("AA104:AG104").Select
Application.CutCopyMode = False
Selection.Copy
Range("AA104:AG105").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=False
Application.CutCopyMode = False
Range("AE107").Select


End Sub

I would like it to move down 1 row in the same columns and repeat the macro. Hope I have what you need.
Jerry
 
Upvote 0
Jerry,

Here's a start:
Code:
Sub Macro1()

ActiveSheet.Range(ActiveCell, ActiveCell.Offset(0, 14)).Copy
Range(ActiveCell.Offset(1, 0).Address).PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
        , Transpose:=False
Range(ActiveCell.Offset(1, 0).Address).Select
Application.CutCopyMode = False

End Sub
This will copy a range of cell based on the currently selected cell and paste it below the currently selected cell and jump down below the pasted cells. I couldn't tell from your code what the desired ranges were.

Dufus
 
Upvote 0
Note that using CTRL+Z isn't a real good idea as that's the reserved shortcut for UNDO.

Smitty
 
Upvote 0
Don't understand why you want to do like this though...
Code:
    With Range("S103:AG103")
       For i = 0 To 1
          .Offset(i).Copy .Offset(i + 1)
       Next
    End With
    Application.CutCopyMode = False
 
Upvote 0
O.K. need to use other key cmd. (smitty)
I can see your code does move down when I use it stand alone.(dufus)
I have embedded it but don't think I understand or need to rerecord the macro so all steps show. Will show how I embedded it. Will run a new recorder and post it later next day. Thanks for all you have done.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 9/24/2006 by Jerry O
'

'
Range("S103:AG103").Select
Selection.Copy
Range("S104").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=False
Range("AA104:AG104").Select
Application.CutCopyMode = False
Selection.Copy
Range("AA104:AG105").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=False
Application.CutCopyMode = False
Range("AE107").Select
With Range("S103:AG103")
For i = 0 To 1
.Offset(i).Copy .Offset(i + 1)
Next
End With
Application.CutCopyMode = False

End Sub




Jerry
 
Upvote 0
It's still unclear which ranges need to be copied where so if you want to take another shot, I think what we have so far can be improved. Just tell us which column and row to start with and which column and row to end with.

Like this for example:
I want to copy from the range row 200 and columns A to G and paste it one row below starting in column AF. The next range to copy is one row below the first one and covers the same columns.

Dufus
 
Upvote 0
Will use ctrl A
Ok copy s107:ag107
paste to s108:ag108
Now
copy aa108:ag108
paste to aa109:ag109
Then I end the cursor in an empty cell ag111
The next days data will then start with a copy s108:ag108
paste to s109:ag109
copy aa109:ag109
paste to aa110:ag110
empty cell 112
ditto every day.
The macro will now show that scenario since i re-recorded it. I think this is now clearer.
See code.
I did look at several samples posted here and there but most copied to an other sheet but nothing like I want to do. Thanks Jerry
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 10/28/2006 by Jerry O
'
' Keyboard Shortcut: Ctrl+a
'
Range("S107:AG107").Select
Selection.Copy
Range("S107:AG108").Select
ActiveSheet.Paste
Range("AA108:AG108").Select
Application.CutCopyMode = False
Selection.Copy
Range("AA108:AG109").Select
ActiveSheet.Paste
Range("AG111").Select
Application.CutCopyMode = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,529
Messages
6,114,155
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top