Archive of Mr Excel Message Board


Back to Controls in Excel archive index
Back to archive home

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


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

Posted by on January 10, 2002 3:54 PM

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


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

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


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.