Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
Here is the code. I am referencing 2 different columns because the column which is doing the selection is sometime blank so the loop needs to reference a column with data in every row. The line the error message appears on is: Set rngNextCell = rngCurrentCell.Offset(1, 0) Sub Select_Level_4() strColumnRange = "M15" str1stColumnRange = "A15" Sheets("Level 4 TBA").Activate Range("A2").Select Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select Selection.Clear Range("A1").Select Sheets("Staff Training").Activate Set rngCurrentCell = Worksheets("Staff Training").Range(strColumnRange) Set rngFirstCell = Worksheets("Staff Training").Range(str1stColumnRange) Do While Not IsEmpty(rngFirstCell) Set rngNextCell = rngCurrentCell.Offset(1, 0) If rngCurrentCell.Value = "TBA" Then rngCurrentCell.EntireRow.Copy Sheets("Level 4 TBA").Activate Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate ActiveCell.PasteSpecial xlPasteValues End If Set rngCurrentCell = rngNextCell Loop End Sub TIA Andrew |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error 1004: Application defined or object defined error | Excel Programming | |||
Runtime error 1004- application defined or object defined error | Excel Programming | |||
Run-time Error 1004: Application-defined or Object-defined Error | Excel Programming | |||
Macro Run-time Error 1004 Application Defined or Object Defined Error | Excel Programming |