Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well, you can write a code that will go through the entire page in one
fell swoop...this assumes two things, first, that the L column has data wether M does or does not, and that L column will return empty when there is no more rows to test Sub Test1() Dim Msgme 'Creates variable named Msgme Dim Sturge 'Creates variable named Sturge Sturge = 1 'Set this to the row number of the first row that contains data (1 = Row 1) Range("L" & Sturge).Select 'Selects starting Cell LabelLoop: If ActiveCell.Value = Empty Then 'If L column cell contains nothing then do this GoTo endme End If ActiveCell.Offset(0, 1).Activate 'This pushes over to M column If ActiveCell.Value = Empty Then 'If M ain't got no batch number then do this Selection.EntireRow.Delete 'Delete it!!! GoTo bypass End If ActiveCell.Offset(1, -1).Activate GoTo LabelLoop bypass: ActiveCell.Offset(0, -1).Activate GoTo LabelLoop endme: Msgme = MsgBox("I am Done!!", vbOKOnly, "BatchFinder") End Sub That should do it. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
PDFMaker and Compile Errors | Excel Discussion (Misc queries) | |||
compile errors | Excel Discussion (Misc queries) | |||
VLOOKUP Compile/Syntax Error | Excel Programming | |||
Handle Compile Errors | Excel Programming | |||
Compile Errors | Excel Programming |