Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code, which is looking to see if there is data in column
"O" starting with row 5 and ending with the "nRow" which is the last row with data in the column. "nRow" could be as high as the maximum rows in Excel. If there is data greater than "0" it copies varius cells to other cells in another sheet. My question is: Is there a more efficiant way to do this? It takes a long time to run this code when there is a lot of data in "O". Thank you! Sub FillAllData() FillCount = 3 For counter = 5 To nRow CellValue = Sheets(BSheets).Range("O" & counter).Value If CellValue 0 Then Sheets(AllSheet).Range("A" & FillCount).Value = Sheets(BSheets).Range("O" & counter).Value Sheets(AllSheet).Range("B" & FillCount).Value = Sheets(BSheets).Range("P" & counter).Value Sheets(AllSheet).Range("D" & FillCount).Value = Sheets(BSheets).Range("Q" & counter).Value Sheets(AllSheet).Range("E" & FillCount).Value = Sheets(BSheets).Range("R" & counter).Value Sheets(AllSheet).Range("F" & FillCount).Value = Sheets(BSheets).Range("S" & counter).Value Sheets(AllSheet).Range("G" & FillCount) = Sheets(BSheets).Range("T" & counter).Value FillCount = FillCount + 1 End If Next counter End Sub -- I am not where I intended to go, but I think I am where I am supposed to be! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
very slow code | Excel Programming | |||
Slow code when used as VBA code instead of macro (copying visible columns) | Excel Programming | |||
Slow code | Excel Programming | |||
SLOW Code... | Excel Programming | |||
Slow Code | Excel Programming |