Good afternoon/morning (wherever you might be in the world)!
I inherited a spreadsheet and I'm trying to keep the methodology consistent with how it was already built.
The author of the spreadsheet used a macro that provides a warning messages to users if they validate the spreadsheet and it's missing (or has incorrect information) to highlight the cell yellow and provide a warning message.
All I want to do is provide a similar message, but I don't need all the data validation (format) built in.
For example, this is a macro he used to return an error or pass validation:
I just need to be able to say, if there is any data in the field....no error, but if not error. It's probably so simple, I'm missing it...but regardless I'm still missing it.
I'll be the first to admit....I'm not exactly sure I should be messing around with this thing called Excel VBA.
ANY HELP WOULD BE GREATLY APPRECIATED!
I inherited a spreadsheet and I'm trying to keep the methodology consistent with how it was already built.
The author of the spreadsheet used a macro that provides a warning messages to users if they validate the spreadsheet and it's missing (or has incorrect information) to highlight the cell yellow and provide a warning message.
All I want to do is provide a similar message, but I don't need all the data validation (format) built in.
For example, this is a macro he used to return an error or pass validation:
Code:
oRow.Cells(1, 8).Value = Validations.CleanNonStndChars(UCase(Trim(oRow.Cells(1, 8).Text)))
If Not Validations.StateValidation(oRow.Cells(1, 8)) Then
.tbOVR_Results = .tbOVR_Results & "Jurisdiction validation error: Row " & Str(oRow.Row) & " please check." + vbNewLine
oRow.Cells(1, 8).Interior.ColorIndex = 6
oRow.Cells(1, 8).AddComment ("The State must be within the United States.")
End If
I just need to be able to say, if there is any data in the field....no error, but if not error. It's probably so simple, I'm missing it...but regardless I'm still missing it.
Code:
[COLOR=red]If the cell has text "End If". If it's blank "Then": [/COLOR]
tbOVR_Results = .tbOVR_Results & "License error: Row " & Str(oRow.Row) & " please check." + vbNewLine
oRow.Cells(1, 8).Interior.ColorIndex = 6
oRow.Cells(1, 8).AddComment ("License information Required.")
End If
I'll be the first to admit....I'm not exactly sure I should be messing around with this thing called Excel VBA.
ANY HELP WOULD BE GREATLY APPRECIATED!
Last edited: