Ideas on VBA method to copy/paste date

MOB

Well-known Member
Joined
Oct 18, 2005
Messages
1,066
Office Version
  1. 365
Platform
  1. Windows
I have data in columns N to S - starts at row 4 and can go down to row 1000 (number of rows can vary)

I want to;

- copy columns N to O plus column P to a new tab
- copy columns N to O plus Q underneath that data
- copy columns N to O plus R underneath that data
- copy columns N to O plus S underneath that data

Thus creating one longer list, 4 times the length of the original list. But only 3 columns wide instead of the original 6

Struggling to get my head round how to tackle this!

Any help would be great.
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
How about
Code:
Sub CopyData()

   Dim UsdRws As Long
   
   UsdRws = Range("N" & Rows.Count).End(xlUp).Row
   With Sheets("Sheet1")
      Range("N4:O" & UsdRws).Copy .Range("A1").Resize((UsdRws - 3) * 4)
      Range("P4:P" & UsdRws).Copy .Range("C1")
      Range("Q4:Q" & UsdRws).Copy .Range("C" & Rows.Count).End(xlUp).Offset(1)
      Range("R4:R" & UsdRws).Copy .Range("C" & Rows.Count).End(xlUp).Offset(1)
      Range("S4:S" & UsdRws).Copy .Range("C" & Rows.Count).End(xlUp).Offset(1)
   End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,204
Members
453,022
Latest member
RobertV1609

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