G
Guest
Guest
I am trying to detect whether a block of cells contains text. I am using the following function to do so--it also puts a zero in empty spaces. The GetLastRow fucntion finds the last row containing anything and returns the row number:
Public Sub FindTextandAddZero()
Count = 0
GetLastRow Count
For Each cell In Range("e2" & ":am" & Count)
If Not (IsNumeric(cell.Value)) Then
response = MsgBox("Row number" & " " & cell.row & " " & "contains the following incorrect text:" & " " & "#" & cell & "#" & "." & " " & "Open " & ImportMasterName & ".csv and correct.")
End If
Next cell
For Each cell In Range("a1" & ":am" & Count)
If cell = Empty Then
cell.Value = 0#
End If
Next cell
End Sub
The problem is that the cells are formated as numeric cells and my procedure is not detecting the text. Does anyone no of another way i could accomplish this? Any help would be appreciated. Regards.
Public Sub FindTextandAddZero()
Count = 0
GetLastRow Count
For Each cell In Range("e2" & ":am" & Count)
If Not (IsNumeric(cell.Value)) Then
response = MsgBox("Row number" & " " & cell.row & " " & "contains the following incorrect text:" & " " & "#" & cell & "#" & "." & " " & "Open " & ImportMasterName & ".csv and correct.")
End If
Next cell
For Each cell In Range("a1" & ":am" & Count)
If cell = Empty Then
cell.Value = 0#
End If
Next cell
End Sub
The problem is that the cells are formated as numeric cells and my procedure is not detecting the text. Does anyone no of another way i could accomplish this? Any help would be appreciated. Regards.