L
LDMueller
I'm trying to write an "If then" statement but could use
some help. If the value of the cell equals a name (text)
then I want to copy a range to another location. If the
value of the cell equals "0" (e.g. zero) then I just want
it to go to the next cell.
I can handle the copy part okay, just not the "If" part
equaling text since the text value will change all the
time.
The following is similar to what I need, but it doesn't
work.
If "C22" = "0" Then 'move to next cell
Application.Goto Reference:="D22"
Else
Application.Goto Reference:="C22"
Range("C21:C36").Select
Selection.Copy
Range("A1").Select
Application.Goto Reference:="D22"
ActiveSheet.Paste
End If
Thanks!
some help. If the value of the cell equals a name (text)
then I want to copy a range to another location. If the
value of the cell equals "0" (e.g. zero) then I just want
it to go to the next cell.
I can handle the copy part okay, just not the "If" part
equaling text since the text value will change all the
time.
The following is similar to what I need, but it doesn't
work.
If "C22" = "0" Then 'move to next cell
Application.Goto Reference:="D22"
Else
Application.Goto Reference:="C22"
Range("C21:C36").Select
Selection.Copy
Range("A1").Select
Application.Goto Reference:="D22"
ActiveSheet.Paste
End If
Thanks!