Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Look up a value from a row after verifying two other values | Excel Worksheet Functions | |||
Verifying uniqueness of records in data | Excel Discussion (Misc queries) | |||
Verifying value of a cell | Excel Discussion (Misc queries) | |||
Verifying Dates | Excel Worksheet Functions | |||
verifying date | Excel Programming |