Excel 2007 VBA code to copy and paste row data into new tabs based on a number range

srsneezealot

New Member
Joined
May 27, 2011
Messages
1
I saw similar posts using vba to copy data into other sheets based on specific values, but I couldn't find code on a range of numbers. Example I have account numbers from 45000-79010, and I need separate tabs based on different ranges of the account numbers.

All my data is on one tab ("Data"). The account numbers are in column C, and the PD Variance is in column I. I need the data rows copied to tabs based on the ranges 45000-56099, 45000-56099, 56100-56999, 67000-67999, & 68000-79010. Then I need data rows copied to new tabs based on the same account ranges, but also based on the PD Variance. For example I need tabs 45000-56099 when the value in column I is greater than or equal to $100,000.

I was planning on using a template so I would just need the code to copy the data into each tab. So I would have a header on the first row, but the data would go into the second row of each tab. My tabs would be named based on the range, and data, so I would have 45000-56099, 45000-56099GT100K, 56100-56999, 56100-56999GT100K, etc.

If I can get the basic code to do this, I can probably manipulate it for my specific ranges, and names, etc.


Let me know if you have any questions, hopefully I was specific enough.
Thanks,
Preston
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,224,534
Messages
6,179,391
Members
452,909
Latest member
VickiS

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