Making 4 columns from 2 columns

rlnye

New Member
Joined
Apr 7, 2002
Messages
43
In Excel 2000, a spreadsheet I use extracts data in two columns (column A1 is numeric and B1 in descriptive text) the number of rows in the two columns varies...sometimes just 6 rows in the two columns othertimes 32 rows. What I need to do is if the number of rows in A1:B? is over 15, divide the number of rows in half and copy the bottom half to D1. In other words if the number of rows is A1:B24...copy the bottom 12 rows A13:B24 to D1. If I need to use VB code can someone help with the code...I'm a new comer to Excel. Thanks
 
Andrew, it makes two rows if the number of rows is 15 or less. What I need to do is make two rows only if there is 15 or more rows...and if less than or more than 15 rows, to continue to run the VB code under your code.

Thanks for taking the time to help.
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Oh, my fault in removing the Exit Sub! The test needs changing using End If.

Code:
If Source.Rows.Count > 15 Then

By the way you only need to press Submit once. I find that the posting has gone even if there is a timeout.
 
Upvote 0
Andrew, I got it to work...I just altered the following line..."If Source.Rows.Count >= 15 Then" and left the code under it, and then added another line..."If Source.Rows.Count <= 15 Then" and added what I wanted it to do along with an End If.

Thanks again for all your help...without it I still would be losing brain cells trying to figure it out.
 
Upvote 0

Forum statistics

Threads
1,215,014
Messages
6,122,697
Members
449,092
Latest member
snoom82

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