I'd like to run a macro based on a cell value being higher than another cell value

sharmon

New Member
Joined
Sep 21, 2014
Messages
10
Hi,

So i have two cells E27 & E28. Both cells are numeric.

E27 has a formula that changes based on some other cells inputs.

If E27 has a higher value than E28 i'd like to run a macro.

Else nothing should happen.

I'm sure this should be simple but i just can't get it to work.

Any help would be great! thanks!
 
Its a little confusing what you are doing when you mentioned another sheet as your Macro1 makes no mention of sheet references so excel will use the activesheet. Maybe if you put your workbook into dropbox and send the link ill take a look.
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I found this code somewhere, it works fine but only responds to a numeric value in E27, whereas i have a formula in E27. Do you know how to change it to make it work? I think i was unnecessarily complicating things with macros.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$27" And IsNumeric(Target) Then
If Target.Value > Target.Offset(1, 0) Then
Target.Offset(1, 0) = Target.Value
End If
End If
End Sub
 
Upvote 0
As you have found that doesn't work for formula. You could use that for an input into a formula if you understand me?
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,844
Members
449,471
Latest member
lachbee

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