Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
divide and copy rows
hi all
i have a single worksheet that has let's say 1000 rows I want to add some VBA that divides the 1000 rows by 10 and copies the 100 groups of rows to either newly created worksheets within the original workbook or to 100 newly crated single worksheet workbooks. Where can i find an example? I guess my pseudo code is X = 1000/n (n=10) Create X workbooks Upper = n Lower = 1 For Y = 1 to X Get rows from Lower to Upper and copy them to workbook(y) Upper = Upper + n Lower = Lower + n Next Y ?? Thanks a lot for your help! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
divide and copy rows
set sh = Activesheet
for i = 1 to 991 step 10 set rng = sh.Cells(i,1).Resize(10,1).EntireRow set sh1 = worksheets.Add(after:=Worksheets(worksheets.count) ) rng.copy sh1.Range("A1") ' optional 'sh1.move Next -- Regards, Tom Ogilvy "glenn" wrote: hi all i have a single worksheet that has let's say 1000 rows I want to add some VBA that divides the 1000 rows by 10 and copies the 100 groups of rows to either newly created worksheets within the original workbook or to 100 newly crated single worksheet workbooks. Where can i find an example? I guess my pseudo code is X = 1000/n (n=10) Create X workbooks Upper = n Lower = 1 For Y = 1 to X Get rows from Lower to Upper and copy them to workbook(y) Upper = Upper + n Lower = Lower + n Next Y ?? Thanks a lot for your help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy & divide by | Excel Discussion (Misc queries) | |||
need to divide value across added rows | Excel Programming | |||
To take the cells in the same row and divide them in rows | Excel Discussion (Misc queries) | |||
Divide Cell Across Rows | Excel Programming | |||
I Need to divide all cells in rows 2 and 3 by 100 | Excel Discussion (Misc queries) |