MrExcel Publishing
Your One Stop for Excel Tips & Solutions

commandButton vs Worksheet_SelectionChange(ByVal...


Posted by Jim on January 10, 2002 3:03 PM

Hi,

I have w/CommandButton_Click():

If [e52] = [e51] Then
[g51] = [g51 - g52]
End If
If [e53] = [e51] Then
[g51] = [g51 - g53]
End if
End Sub

My prob: I'm trying to get away from a commandbutton
and use the above code w/ Worksheet_SelectionChange()

Any advice would be appreciated.
Jim


Posted by on January 10, 2002 3:54 PM

Write the macro using each cell reference like this: Range("A1")


Put this in your macro:

If range("e52") = range("e51") Then
range("g51") = range("g51") - range("g52")
End If
If range("e53") = range("e51") Then
range("g51") = range("g51") - range("g53")
End if

Posted by Jim on January 10, 2002 4:34 PM

Re: Write the macro using each cell reference like this: Range("A1")Thanks for the advice,I'll try it