airportzoo
New Member
- Joined
- Jun 24, 2011
- Messages
- 14
Hello
This bit of code sits in the middle of a big bit of code, but I'm getting the error
"Compile error:
Type mismatch"
on the
bit.
The idea is that before the main code in the macro executes, this bit of code will make sure there are no #REF! errors in column O, and if there are a msgbox will come up and indicate a problem and then execute another macro to repair the #REFs.
If anyone can provide some direction, that would be great!
Thanks!
This bit of code sits in the middle of a big bit of code, but I'm getting the error
"Compile error:
Type mismatch"
on the
Code:
"O2:O200"
Code:
If Application.WorksheetFunction.CountIf("O2:O200", "#REF!") >= 1 Then
MsgBox("There is a problem with the database. The repair macro will run to fix this. Then send the text again.", vbOKOnly, "Error") = vbOK
Run macro2
Exit Sub
Else
The idea is that before the main code in the macro executes, this bit of code will make sure there are no #REF! errors in column O, and if there are a msgbox will come up and indicate a problem and then execute another macro to repair the #REFs.
If anyone can provide some direction, that would be great!
Thanks!