[VBA Question]: Copy/paste every single quarter - replicate 40 times in a quarter

fjacruz

New Member
Joined
Feb 15, 2019
Messages
8
Hi guys,

I'm not particular specialist on vba code but it'd be great if I got a automatization here.
Every single quarter I need to copy a paste (to break formulas) a specific column (lets assume D column) to the first column to the right...the idea behind is add a new column to the structure every single quarter so i've to find to code in a way to find the next empty column. On top of that, i need to replicate it 40 times per quarter. All tabs are starting by same name lets assume (Resume xxx). Firstly i need to update computation across the 40 tabs and then execute it.

I appreciate all valuable input.

Thank you
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Perhaps something along these lines? (Test it on a backup copy of your workbook)

VBA Code:
Sub MyCopy()

    Dim ws As Worksheet
    
    For Each ws In ThisWorkbook.Worksheets
        If Left(ws.Name, 6) = "Resume" Then
            ws.Range("D:D").Copy
            'Assumes first empty column is to the right of last populated cell in row 1
            With ws.Cells(1, Columns.Count).End(xlToLeft).Offset(, 1)
                .PasteSpecial Paste:=xlPasteValues
                .PasteSpecial Paste:=xlPasteFormats
            End With
        End If
    Next ws

End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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