Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to format cells to duplicate for every 5 rows.
I am working on a sheet that already has ID numbers in column a. in the
format listed below. This goes on for about 300 rows 47846 47847 How can I format the sheet to look like this: 47846 47846 47846 47846 47846 47840 47840 47840 47840 47840 I need to list information in column b and c that corresponds to column a. However, column a must contain the corresponding id number. Is there a way I can automate this instead of doing it manually? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to format cells to duplicate for every 5 rows.
The macro below copies each row 4 times to give a total of 5 rows with each
id. Wasn't sure if you wanted entire row copies Sub insert4rows() LastRow = Cells(Rows.Count, "A").End(xlUp).Row For RowCount = LastRow To 1 Step -1 Rows(RowCount).Copy Rows(RowCount & ":" & (RowCount + 3)).Insert Shift:=xlDown Next RowCount End Sub "Alicia" wrote: I am working on a sheet that already has ID numbers in column a. in the format listed below. This goes on for about 300 rows 47846 47847 How can I format the sheet to look like this: 47846 47846 47846 47846 47846 47840 47840 47840 47840 47840 I need to list information in column b and c that corresponds to column a. However, column a must contain the corresponding id number. Is there a way I can automate this instead of doing it manually? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to format cells to duplicate for every 5 rows.
This worked perfectly.
Thanks! "Joel" wrote: The macro below copies each row 4 times to give a total of 5 rows with each id. Wasn't sure if you wanted entire row copies Sub insert4rows() LastRow = Cells(Rows.Count, "A").End(xlUp).Row For RowCount = LastRow To 1 Step -1 Rows(RowCount).Copy Rows(RowCount & ":" & (RowCount + 3)).Insert Shift:=xlDown Next RowCount End Sub "Alicia" wrote: I am working on a sheet that already has ID numbers in column a. in the format listed below. This goes on for about 300 rows 47846 47847 How can I format the sheet to look like this: 47846 47846 47846 47846 47846 47840 47840 47840 47840 47840 I need to list information in column b and c that corresponds to column a. However, column a must contain the corresponding id number. Is there a way I can automate this instead of doing it manually? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I find duplicate occurances of three cells in rows? | Excel Worksheet Functions | |||
Highliting Duplicate Cells across multiple rows | Excel Worksheet Functions | |||
merging cells and then deleting rows and duplicate entry | Excel Programming | |||
Remove duplicate rows and sum cells | Excel Programming | |||
How can I find Duplicate Cells or Rows | Excel Programming |