copy active row cell to another

Status
Not open for further replies.

Gregfox

Board Regular
Joined
Apr 12, 2011
Messages
120
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.
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
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,480
Messages
6,125,048
Members
449,206
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top