Checking row for data
Something like this maybe?
Sub CheckForSixItems()
Dim RW As Long
Dim Items As Long
Dim Answer As String
' Change the 1 to 54 to your actual row range
For RW = 1 To 54
Items = WorksheetFunction.CountA(Range(Cells(RW, "D"), Cells(RW, "S")))
If Items < 6 Then
Answer = Answer & "Row " & RW & " < 6" & vbCrLf
ElseIf Items 6 Then
Answer = Answer & "Row " & RW & " 6" & vbCrLf
End If
Next
MsgBox Answer
End Sub
--
Rick (MVP - Excel)
"CR" wrote in message
m...
I have a worksheet with 16 columns and 54 rows.
Each row has a range D6 to S6, D7 to S7 ect.
I want to run a macro that checks each range to verify that only 6 columns
in each row have data entered.
I guess a dialog box or something to tell me which ranges have <6 or 6 in
them.
Thanks, much appreciated
CR
|