formula woes

James

Active Member
Joined
Feb 17, 2002
Messages
327
Private Sub CommandButton1_Click()
Dim rng As Range
Dim rw As Integer
Dim dest As String

With Selection
If [E6 = E47] Then
[G51].Value = [G47 - E6]
End If
Range("B6:G6").Select
Selection.Copy
ActiveSheet.Paste
Application.CutCopyMode = False
End With
End Sub

The long and the short of it is it's not
performing the subtraction, but it does the
copy and paste

Any help would be appreciated

James
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
On 2002-04-22 15:17, James wrote:
Private Sub CommandButton1_Click()
Dim rng As Range
Dim rw As Integer
Dim dest As String

With Selection
If [E6 = E47] Then
[G51].Value = [G47 - E6]
End If
Range("B6:G6").Select
Selection.Copy
ActiveSheet.Paste
Application.CutCopyMode = False
End With
End Sub

The long and the short of it is it's not
performing the subtraction, but it does the
copy and paste

Any help would be appreciated

James

I don't follow what you are doing, but this should capture the problems with the IF statement, unless [E6] = [E47] is always FALSE.


If [E6] = [E47] Then
[G51].Value = [G47] - [E6]
End If

HTH,
Jay
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,394
Members
448,957
Latest member
Hat4Life

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