I am working on a project where it is necessary to check that a large number of cells meet a number of criteria.
I have been able to use the code below to check whether a cell contains a value in a numeric format. However, I also need a way to check whether a cell contains a value formatted as US Currency.
If Not Application.WorksheetFunction.IsNumber(Range(StringColumn & StringRow).Value) Then
MsgBox "Test Failed at " & StringColumn & StringRow
Exit Sub
Else: MsgBox "Valid format for cell " & StringColumn & StringRow
End If
StringColumn and StringRow are variables that supply the cell reference.
Your help is appreciated. Thanks!
Assuming you are using
$as your currency, you can try this:If you have another currency, replace the
$with your currency symbol.