Copy/Paste Loop Conditional Question

SirAsksAlott

New Member
Joined
Aug 21, 2014
Messages
7
Completely new at VBA, having fun learning though. I'm trying to automate reports at the office, and I'm having an issue particularly with looping a specific process. Here's what I have so far:

PHP:
Sheets("Attach Rate").Activate    

Range("F1").EntireColumn.Insert
Range("E:E").CopyIf Range("F3").Value <> "YTD" Then
Range("F:F").PasteSpecial xlPasteAll End If
Range("F:F").Copy
If Range("G3").Value <> "YTD" Then
Range("G:G").PasteSpecial xlPasteAll
End If

What i'd love to do is loop paste one column, and then continually paste that column over entire columns to the right until "YTD" is located at the 3rd row of the next column, and then to stop. This report will continuously add a new week, so the column YTF will continually move over one to the right every week, so it has to be a dynamic loop that will check for that.

Thanks
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,215,643
Messages
6,125,990
Members
449,277
Latest member
Fanamos298

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