Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Need Help with Programming-Syntax/Compile Errors

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PDFMaker and Compile Errors LinKay Excel Discussion (Misc queries) 2 February 5th 08 06:10 PM
compile errors johnny Excel Discussion (Misc queries) 1 February 24th 05 11:49 PM
VLOOKUP Compile/Syntax Error JimFor Excel Programming 4 December 22nd 04 06:10 PM
Handle Compile Errors JeffT Excel Programming 1 October 14th 04 01:38 PM
Compile Errors Patricia[_3_] Excel Programming 2 October 17th 03 11:48 AM


All times are GMT +1. The time now is 10:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"