Looping and offset

DAH26952

New Member
Joined
May 12, 2011
Messages
2
I have a created a formatting template but it only works on one item at a time. I need to automate the creation by going through a list.

I need to be able to copy the first item to a cell, let the macro run, then go back to the next item in the list and repeat the macro.

For example, I have a list of 5 items in column G1-:5, i need to take item in G1, copy it to A1, run the macro, then go to G2 and repeat.

Any help would be appreciated
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Why do you need a loop?

Code:
Sub Test
Range("G1:G5").Copy Range("A1")
End Sub
 
Upvote 0
Let me clear up what I am doing. I have a list of about 200 dept id's i need to create new templates for. Instead of individually running each template by changing the id, I want to have a macro to loop through my list, select each id one at a time, run my current macro (including essbase), then go to the next id on the list. As a note, I cannot have the list within the essbase retrieve as it will implode the template.

Hopefully this clears up any questions. Thanks
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,916
Members
452,949
Latest member
beartooth91

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