Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Action depending on cell Value
Hi,
I am trying to get a Macro that create one thing if a Cell Value in a specific cell is lower than 10000, and something else if the same value is higher than or equal to 10000. How do I make this happen? -- Tomas S |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Action depending on cell Value
Could you build on this?
Private Sub Worksheet_Change(ByVal Target As Range) If Cells(1, 1).Value < 10000 Then MsgBox ("Do Something") Else MsgBox ("Do Something else") End If End Sub Mike "Tomas Stroem" wrote: Hi, I am trying to get a Macro that create one thing if a Cell Value in a specific cell is lower than 10000, and something else if the same value is higher than or equal to 10000. How do I make this happen? -- Tomas S |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Action depending on cell Value
Hi Tomas,
Try something like: '============= Private Sub Worksheet_Change(ByVal Target As Range) Dim Rng As Range Set Rng = Me.Range("A1") '<<==== CHANGE Set Rng = Intersect(Rng, Target) If Not Rng Is Nothing Then With Rng If .Value < 1000 Then 'do somethimg. e.g.: MsgBox "Lower" Else MsgBox "Higher" End If End With End If End Sub '<<============= This is worksheet event code and should be pasted into the worksheets's code module (not a standard module and not the workbook's ThisWorkbook module): Right-click the worksheet's tab Select 'View Code' from the menu and paste the code. Alt-F11 to return to Excel. --- Regards, Norman "Tomas Stroem" wrote in message ... Hi, I am trying to get a Macro that create one thing if a Cell Value in a specific cell is lower than 10000, and something else if the same value is higher than or equal to 10000. How do I make this happen? -- Tomas S |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excell copy action pauses for 15 second for the smallest action | Excel Discussion (Misc queries) | |||
Change to a Cell causes action | Excel Programming | |||
action on cell activate | Excel Programming | |||
Action after Activate a cell | Excel Programming |