Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Change 11 in
For i = 1 To 11 to the number of rows you have... or you can use Range("A65536").End(xlUp).Row "Sheeloo" wrote: Sub test() Dim i As Integer Dim SheetArray(6) As String Dim SheetRowNo(6) As Integer For i = 1 To 6 SheetArray(i) = "Test" & i SheetRowNo(i) = 1 Next i Dim CurrCol(6) As String CurrCol(1) = "A" CurrCol(1) = "B" CurrCol(1) = "C" CurrCol(1) = "D" CurrCol(1) = "E" CurrCol(1) = "F" Dim j As Integer j = 1 i = 2 For i = 1 To 11 For j = 1 To 6 ActiveWorkbook.Sheets("CMG SA Master").Activate If Cells(i, j) = "X" Then Cells(i, 1).EntireRow.Copy Sheets(SheetArray(j)).Activate Cells(SheetRowNo(j), 1).Select ActiveSheet.Paste SheetRowNo(j) = SheetRowNo(j) + 1 End If Next j Next i End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions |