Looping Problem - Need Help For Client - Excel 2007

dpalmer013

New Member
Joined
Dec 11, 2013
Messages
6
I'm currently working on a macro for a client and it involves the use of looping. Essentially what I want to do is find every instance where "EERT OUPUT" header is mentioned in the spreadsheet then rearrange the stacked data below the EERT OUTPUT header into one line or row then proceed to the next EERT OUTPUT header perform the same rearranging activities and so on and so forth. The problem is that the EERT OUTPUT sections aren't sequential. The first EERT OUTPUT header would be in cell A16, the three lines of data (covering about 10 columns) would be provided beneath the header, and then the next EERT OUTPUT header wouldn't be found until cell A112. So about every 100 rows or so the EERT OUTPUT header appears, but varies. I've tried a ton of different things with the VBA, but I think I reached the limitations of my knowledge. Here's the VBA I have:

Do
Cells.Find(What:="EERT OUTPUT", After:=ActiveCell, LookIn:=xlValues,_
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,_
MatchCase:=True, SearchFormat:=False).Activate
ActiveCell.Offset(4,0).Range("A1:N2"). Select
Selection.Copy
ActiveCell.Offset(-3,16).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(6,-16).Range("A1:M2"). Select
Selection.Copy
ActiveCell.Offset(-6,30).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(9,-30).Range("A1:K2"). Select
Selection.Copy
ActiveCell.Offset(-9,-43).Range("A1").Select
ActiveSheet.Paste
Loop

I also want to be able to continue the macro after exiting the loop and perform additional processes prior to the loop.

Any help is much appreciated!!!!!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,215,361
Messages
6,124,497
Members
449,166
Latest member
hokjock

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