PC Review


Reply
Thread Tools Rate Thread

Action depending on cell Value

 
 
=?Utf-8?B?VG9tYXMgU3Ryb2Vt?=
Guest
Posts: n/a
 
      10th May 2007
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 With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      10th May 2007
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

 
Reply With Quote
 
Norman Jones
Guest
Posts: n/a
 
      10th May 2007
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" <(E-Mail Removed)> wrote in message
news:326B8FCB-72AA-4779-8ED1-(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
action depending on user susan Microsoft Access Forms 2 27th Oct 2008 04:43 PM
How can i change cell colour depending on month of date in cell? andy75 Microsoft Excel Misc 2 6th Jan 2006 07:46 AM
How do I change the color of a cell depending on the result of the function in that cell Mo Childs Microsoft Excel Programming 4 1st Nov 2005 09:30 PM
Formula needed: Return cell value in a range depending on other cell values LavaDude Microsoft Excel Discussion 8 19th May 2005 11:37 PM
Fill cell folor depending on result in the cell ? GSBohn Microsoft Excel Worksheet Functions 2 10th Oct 2004 10:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:59 PM.