What IF

leoj823

Board Regular
Joined
Aug 30, 2005
Messages
73
I need a formula to do the following. When I enter an x in f26 I need the figure in e26 to double.

Let me rephrase the above request. I need a formula to do the following. When I enter a x in f26 thru f47 I need the amounts in e26 thru e47 to double. The example would be e26 has an amount of 9 if a x appears in f26 then the 9 in e26 would double to 18. I hope I'm explaining myself properly. Please also know I have not use macros. So if a macro is the answer I need help with the input.

Leo
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Try this: right click the sheet tab, select View Code and paste in

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("F26:F47")) Is Nothing Then Exit Sub
If LCase(Target.Value) = "x" Then
    Application.EnableEvents = False
    With Target.Offset(, -1)
        .Value = .Value * 2
    End With
    Application.EnableEvents = True
End If
End Sub
 
Upvote 0
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range, d As Range
Set d = Intersect(Target, Range("F26:F47"))
If d Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each c In d
    If c = "x" Then
        With c.Offset(, -1)
            If IsNumeric(.Value) Then .Value = .Value * 2
        End With
    End If
Next
Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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