CUt Unknown sized item

biotechguy

New Member
Joined
Jun 1, 2006
Messages
43
I have a spreadsheet that returns data in 12 Columns (A-L). My goal is to have the G-L columns be cut and then added to the bottom of the A-L columns.

The problem I have is that both sets of columns can have varying amounts of rows. Also, I have a header region in columns A-L that goes to the seventh row.

How can I go about having a macro do this?

Thanks
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Definately make backup copy first.

But this should work.

Code:
Sub Test()
for i = 1 to 6
LR1 = Cells(Rows.Count, i).End(xlup).Row
LR2 = Cells(Rows.Count, i + 6).End(xlup).Row

Range(Cells(8, i + 6), Cells(LR2, i + 6)).Copy Cells(LR1 + 1, i)
next i
Range("G:L").EntireColumn.Delete
End Sub
 
Upvote 0

biotechguy

New Member
Joined
Jun 1, 2006
Messages
43
Almost got it

The macro that was sent was almost perfect, but:

The line from G7:L7 is not getting transfered over :(.

I know this is a simple change, but I cant figure it out
 
Upvote 0

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
You said you had headers going through up to row 7, so I started on row 8...

change the 8 to a 7
 
Upvote 0

Forum statistics

Threads
1,191,395
Messages
5,986,357
Members
440,019
Latest member
Natalie12138

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
Top