Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Show one of multiple comment boxes based on value

I have a worksheet that includes multiple comment boxes and have come across
something I need help with.

If the value in a1 15 then show a warning "value is greater than 15"
If the valude in a1 < 15 then show "acceptable value"

I'm a newbie at VB and Script Editor so details would be most appreciated!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Show one of multiple comment boxes based on value

Hi
What about a1 = 15?
Seems a lot of trouble to put this in a cell comment, if that is what
you mean. In a second column you could put the formula
=if(a1<15,"acceptable value","value is greater than or equal to 15")

or you could use conditional formatting, with condition a1<15 to colour
acceptable values.

No need for macros with either of these approaches.

regards
Paul

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Show one of multiple comment boxes based on value

right click on the worksheet tab and select view code.

then choose the Calculate event.

Private Sub Worksheet_Calculate()
if Range("A1").Value 15 then
Range("A1").NoteText Text:="value is greater than 15"
else
Range("A1").NoteText Text:="acceptable value"
end if
End Sub

If the cell will be altered by editing it, then perhaps you want to use
Data=Validation which does not require a macro, but can be overwritten by
pasting into the cell.

--
Regards,
Tom Ogilvy


" wrote:

Hi
What about a1 = 15?
Seems a lot of trouble to put this in a cell comment, if that is what
you mean. In a second column you could put the formula
=if(a1<15,"acceptable value","value is greater than or equal to 15")

or you could use conditional formatting, with condition a1<15 to colour
acceptable values.

No need for macros with either of these approaches.

regards
Paul


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Show one of multiple comment boxes based on value

I never thought about validation. That should work perfectly..thanks for your
help!!

Tom Ogilvy wrote:
right click on the worksheet tab and select view code.

then choose the Calculate event.

Private Sub Worksheet_Calculate()
if Range("A1").Value 15 then
Range("A1").NoteText Text:="value is greater than 15"
else
Range("A1").NoteText Text:="acceptable value"
end if
End Sub

If the cell will be altered by editing it, then perhaps you want to use
Data=Validation which does not require a macro, but can be overwritten by
pasting into the cell.

Hi
What about a1 = 15?

[quoted text clipped - 9 lines]
regards
Paul

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Show one of multiple comment boxes based on value

Thanks for the response. I thought about that, but this is going to be a
document used by multiple people, and the purpose of the comment box is to
play a role of a "warning" are you sure you want to use that value...any
ideas?

wrote:
Hi
What about a1 = 15?
Seems a lot of trouble to put this in a cell comment, if that is what
you mean. In a second column you could put the formula
=if(a1<15,"acceptable value","value is greater than or equal to 15")

or you could use conditional formatting, with condition a1<15 to colour
acceptable values.

No need for macros with either of these approaches.

regards
Paul



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
Hide & Show Rows based on Check Boxes loza Excel Discussion (Misc queries) 1 September 14th 08 01:49 AM
Can one cell hold multiple check boxes (and then sort based off e. OT Excel Discussion (Misc queries) 1 March 29th 06 07:32 PM
Show top five records based on meeting multiple criteria Joe D Excel Worksheet Functions 4 November 20th 05 11:51 PM
How can I edit a comment w/o first having to select Show Comment Mary Ann Excel Discussion (Misc queries) 1 August 26th 05 12:34 AM
Comment Boxes Rob Fenn Excel Programming 3 July 2nd 04 09:29 AM


All times are GMT +1. The time now is 04:05 PM.

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

About Us

"It's about Microsoft Excel"