Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excell copy action pauses for 15 second for the smallest action Meekal Excel Discussion (Misc queries) 1 January 28th 10 04:30 PM
Change to a Cell causes action Jordan Excel Programming 3 April 6th 06 05:15 PM
action on cell activate KimR.Hammel[_2_] Excel Programming 1 September 15th 05 08:16 PM
Action after Activate a cell tang lk[_2_] Excel Programming 2 April 10th 05 12:24 PM


All times are GMT +1. The time now is 06:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"