Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
tjb
 
Posts: n/a
Default conditional error for option button

When the user clicks a command button, there should be an error message if
data is in cell A1 and one of three option buttons is NOT checked. If no
data is in cell A1 then the option buttons should be ignored. Any
suggestions?
  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
just put some code behind the click event of your command button. Something
like

......
if activesheet.range("A1").value<"" then
if not optionbutton1.value then
msgbox "Error"
end if
end if
....

--
Regards
Frank Kabel
Frankfurt, Germany
"tjb" schrieb im Newsbeitrag
...
When the user clicks a command button, there should be an error message if
data is in cell A1 and one of three option buttons is NOT checked. If no
data is in cell A1 then the option buttons should be ignored. Any
suggestions?



  #3   Report Post  
tjb
 
Posts: n/a
Default

This is good except it needs to show the msgbox if there is data in A1 and
ANY one of the three option buttons aren't checked.

Right now, it's only showing the error if one specific option out of the
three isn't checked.

Thanks again Frank! You're awesome!

"Frank Kabel" wrote:

Hi
just put some code behind the click event of your command button. Something
like

......
if activesheet.range("A1").value<"" then
if not optionbutton1.value then
msgbox "Error"
end if
end if
....

--
Regards
Frank Kabel
Frankfurt, Germany
"tjb" schrieb im Newsbeitrag
...
When the user clicks a command button, there should be an error message if
data is in cell A1 and one of three option buttons is NOT checked. If no
data is in cell A1 then the option buttons should be ignored. Any
suggestions?




  #4   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
should be easy for you to adapt :-) Do you mean:
......
if activesheet.range("A1").value<"" then
if (not optionbutton1.value) or (not optionbutton2.value) or (not
optionbutton3.value) then
msgbox "Error"
end if
end if
....

--
Regards
Frank Kabel
Frankfurt, Germany
"tjb" schrieb im Newsbeitrag
...
This is good except it needs to show the msgbox if there is data in A1 and
ANY one of the three option buttons aren't checked.

Right now, it's only showing the error if one specific option out of the
three isn't checked.

Thanks again Frank! You're awesome!

"Frank Kabel" wrote:

Hi
just put some code behind the click event of your command button.
Something
like

......
if activesheet.range("A1").value<"" then
if not optionbutton1.value then
msgbox "Error"
end if
end if
....

--
Regards
Frank Kabel
Frankfurt, Germany
"tjb" schrieb im Newsbeitrag
...
When the user clicks a command button, there should be an error message
if
data is in cell A1 and one of three option buttons is NOT checked. If
no
data is in cell A1 then the option buttons should be ignored. Any
suggestions?






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
Command Button VBA code Dave Peterson Excel Discussion (Misc queries) 2 January 25th 05 11:28 PM
Macro to simply bring up the Find dialogue box?? marika1981 Excel Discussion (Misc queries) 14 January 14th 05 10:47 PM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM
command button moves Stuart Excel Discussion (Misc queries) 2 December 15th 04 05:56 PM
How do I setup a spin button in excel Andy K Excel Discussion (Misc queries) 1 November 26th 04 09:08 PM


All times are GMT +1. The time now is 09:42 AM.

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"