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
 
See if this does what you want:

<font face=Tahoma><SPAN style="color:#00007F">Sub</SPAN> Foo()
    <SPAN style="color:#00007F">Dim</SPAN> rng <SPAN style="color:#00007F">As</SPAN> Range, rng1 <SPAN style="color:#00007F">As</SPAN> Range
        <SPAN style="color:#00007F">Set</SPAN> rng = Cells(Rows.Count, "S").End(xlUp)
        <SPAN style="color:#00007F">Set</SPAN> rng1 = Cells(Rows.Count, "S").End(xlUp).Offset(, 14)
        
        Range(rng, rng1).Copy rng.Offset(1)
        Range(rng.Offset(, 8), rng.Offset(, 14)).Copy rng.Offset(2, 8)
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
</FONT>

HTH,

Smitty

Note: CTRL+A isn't a good one either as that's reserved for Select-->All. ;) CTRL+Q, W, E, R are good options, and far enough out of normal reach that you shouldn't mistake them for something else.
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Smitty,
Stand alone no it didn't. Embeded in the recorder still didn't seem to do any thing. I then tried to add the ranges but it didn't like the way i was coding it.
I don't know what more to say or do.
I tried to compare what you wrote and what i saw at Tushar-Mehta but I don't get it.
I know you are trying to stream line the code but I would be happy if it just moved the recording down one cell and did a repeat of the recording.
Will change to ctrl+q

:oops: :unsure:
Jerry
 
Upvote 0
Jerry

What in plain English do you want to do?
 
Upvote 0
Jerry,

It worked fine for me based on the criteria that you mentioned.

In the VBE goto Insert-->Module and paste the code in there.

Smitty
 
Upvote 0
oops Smitty,
Of course I had collected more Stock mkt data and didn't see it move till I ran it 4 times."FOO" works perfect. Thanks for your time and knowledge.
Jerry :-> :-> :biggrin:
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,369
Members
449,080
Latest member
Armadillos

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