LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Verifying all data in each row is filled in

John,
This is how I'd do it. Maybe there's a better way though.

Sub CheckForMissingData()
Dim x, y, towhere As Integer
Dim isOK, isDone As Boolean

towhere = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell) .Row
isOK = True

'Check the first 12 columns...
For y = 1 To 12
For x = 1 To towhere
If ActiveSheet.Cells(x, y) = "" Then
isOK = False
Exit For
End If
Next x
If Not isOK Then Exit For
Next y

'Check column 13, look for "done"...
If isOK Then
isDone = False
For x = 1 To towhere
If ActiveSheet.Cells(x, 13) = "" Then
isOK = False
Exit For
ElseIf ActiveSheet.Cells(x, 13) = "done" Then
isDone = True
End If
Next x
End If

'Check column 14 if necessary...
If isOK And Not isDone Then
For x = 1 To towhere
If ActiveSheet.Cells(x, 14) = "" Then
isOK = False
Exit For
End If
Next x
End If

If isOK Then
MsgBox "All cells have been filled.", vbExclamation, "Complete"
Else
MsgBox "Not all cells are filled in.", vbExclamation, "Incomplete"
End If
End Su

--
Message posted from http://www.ExcelForum.com

 
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
Look up a value from a row after verifying two other values Paul W Excel Worksheet Functions 11 September 1st 08 08:59 PM
Verifying uniqueness of records in data arad Excel Discussion (Misc queries) 4 June 25th 07 05:50 PM
Verifying value of a cell El Criollo Excel Discussion (Misc queries) 7 December 12th 06 10:21 AM
Verifying Dates gilbert Excel Worksheet Functions 1 September 8th 05 03:22 AM
verifying date MacroMan Excel Programming 0 July 30th 03 10:38 PM


All times are GMT +1. The time now is 10:11 AM.

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"