LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help me clean this up...


Thanks - I cleaned it up quite a bit and it is doing 99% of what I wan
to. Thanks so much for the help, I really appreciate it.


Private Sub CommandButton7_Click()
Dim varAnswer As String

varAnswer = MsgBox("Are you certain you wish to proceed? This canno
be undone." & Chr(10) & Chr(10) & "Edits to this workbook my only b
entered into your Data Sheet manually once the current data i
compiled.", vbOKCancel)
If varAnswer = vbCancel Then
Exit Sub
End If
Dim Lrow As Long
Dim CalcMode As Long
Dim StartRow As Long
Dim EndRow As Long

With Worksheets("ws1")
.DisplayPageBreaks = False
StartRow = 2
EndRow = 21
For Lrow = EndRow To StartRow Step -1
If IsError(.Cells(Lrow, "a").Value) Then
'Do nothing, This avoid a error if there is a error in the cell

ElseIf .Cells(Lrow, "A").Value <= " " Then .Rows(Lrow).Delete

'This will delete the row if the cell is empty

End If
Worksheets("ws1").Range("a2:m21").copy
Next

MsgBox ("Your inspection data for this worksheet has been compiled.
Please go immeditately to the current version of you Dat
Sheet/PivotTable to import this data.")
End With
End Sub



--
BigDav
-----------------------------------------------------------------------
BigDave's Profile: http://www.excelforum.com/member.php...nfo&userid=774
View this thread: http://www.excelforum.com/showthread.php?threadid=37986

 
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
clean up code a little terilad Excel Discussion (Misc queries) 12 April 12th 10 07:35 PM
I need to clean a database Bryan Excel Discussion (Misc queries) 1 September 12th 06 02:13 AM
Clean Up Data ultra_xcyter Excel Discussion (Misc queries) 2 August 11th 06 08:49 PM
Help clean up this code... scottnshelly[_32_] Excel Programming 8 June 21st 04 09:30 PM
=clean(a1) news.verizon.net Excel Programming 2 August 25th 03 11:08 PM


All times are GMT +1. The time now is 03:45 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"