MrExcel Publishing
Your One Stop for Excel Tips & Solutions

calling all VBA heads

Posted by Jim on June 21, 2001 4:16 PM

I have code on commandbutton_Click()
In this line of code i want the subtraction to take place
only once and then follow the rest of the code I.E.:
If[g17] > 0 Then
[G23].Value = [G23] - [G17](Only subtract G17 once then
Blah, Blah, Blah
Any help is appreciated

Posted by Dan on June 21, 2001 5:41 PM

If Worksheets("Sheet1").Cells(17, 7).Value > 0 Then
Worksheets("Sheet1").Cells(23, 7).Value = _
Worksheets("Sheet1").Cells(23, 7).Value - _
Worksheets("Sheet1").Cells(17, 7).Value
End If