Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help with Msgbox

i did conditional formatting that if a cell value is <=2 change th
color to purpel,
then after that did writ a code that makes a Msgbox appears as
wornning followed by another
Msgbox that give the exact addrress of the cell that contain <=2.....

i tried to with this code, but it did not work........
any hints is appreciated.............


Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
'Dim myCheck As Integer

For Each c In Sheet3.Range("E32:E1800").Cells
If c.Interior.ColorIndex < -4142 Then
If c.Value <= 2 Then
c.Interior.ColorIndex = 3
MsgBox """?C????I ??I ???C? C??I??? ???E ?E? ", vbOKOnly, " Warnning"
MsgBox c.Address
End If
End If
Next
End Sub

yours
hesha

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default help with Msgbox

Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
'Dim myCheck As Integer

For Each c In Sheet3.Range("E32:E1800").Cells

If c.Value <= 2 Then
c.Interior.ColorIndex = 3
MsgBox """?C????I ??I ???C? C??I??? ???E ?E? ", vbOKOnly, " Warnning"
MsgBox c.Address
End If

Next
End Sub

Conditional formatting doesn't change the value of the interior.colorindex
property. Since you are checking the condition of the value being less than
or equal to 2, it should work if you remove the colorindex check.

--
Regards,
Tom Ogilvy

"helmekki " wrote in message
...
i did conditional formatting that if a cell value is <=2 change the
color to purpel,
then after that did writ a code that makes a Msgbox appears as a
wornning followed by another
Msgbox that give the exact addrress of the cell that contain <=2.....

i tried to with this code, but it did not work........
any hints is appreciated.............


Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
'Dim myCheck As Integer

For Each c In Sheet3.Range("E32:E1800").Cells
If c.Interior.ColorIndex < -4142 Then
If c.Value <= 2 Then
c.Interior.ColorIndex = 3
MsgBox """?C????I ??I ???C? C??I??? ???E ?E? ", vbOKOnly, " Warnning"
MsgBox c.Address
End If
End If
Next
End Sub

yours
hesham


---
Message posted from http://www.ExcelForum.com/



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
MsgBox bumper338 Excel Discussion (Misc queries) 1 December 22nd 06 11:32 PM
msgbox scottnshelly[_29_] Excel Programming 1 April 29th 04 07:47 AM
MsgBox Randal W. Hozeski Excel Programming 1 January 2nd 04 08:54 PM
MsgBox redmad Excel Programming 1 August 1st 03 12:18 AM
MsgBox Phil Perry Excel Programming 1 July 9th 03 07:38 PM


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

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"