Name error
I’m trying to use VBA to test if cell (in the active row) [C] has no number in it or is blank, and also test if [F] has a number in it. If true then copy the condense of [F] to [M].
Everything seems to work until it get to the last line “copy “F” to M” I get a #NAME error.
Thanks.
I’m trying to use VBA to test if cell (in the active row) [C] has no number in it or is blank, and also test if [F] has a number in it. If true then copy the condense of [F] to [M].
Everything seems to work until it get to the last line “copy “F” to M” I get a #NAME error.
Thanks.
Code:
Sub CopyTo_M()
If (Range("C" & ActiveCell.Row).Value > 0) And (IsNumeric(Range("c" & ActiveCell.Row).Value) Or Application.WorksheetFunction.IsText(Range("c" & ActiveCell.Row).Value)) Then
Range("m" & ActiveCell.Row).Value = "E X I T -C is not empty"
Exit Sub
ElseIf (Range("F" & ActiveCell.Row).Value > 0) And (IsNumeric(Range("F" & ActiveCell.Row).Value)) Then
Range("m" & ActiveCell.Row).Value = "F IS numberic, C is blank"
Range("m" & ActiveCell.Row) = Range("f" & ActiveCell.Row).Copy
Else
Range("m" & ActiveCell.Row).Value = "C and F are empty"
End If
End Sub