Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Selecting Radio Buttons by Using Macros

Hello,

I created two radio buttons on a spreadsheet where a user can select
one button for Yes and the other for No. When I right click these
buttons, I notice the names (shown on the left hand side of the
formula bar) a

Option Button 3 (for No)
Option Button 4 (for Yes)


I'd like to create a macro that automatically selects the Yes or No
button depending on a cell value in another tab. If the cell value is
1, the macro should select Yes. If the value is 0 the macro should
select No.

How do I go about doing this?

Can someone help me out with some code?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Selecting Radio Buttons by Using Macros

Hi,

maybe something along these lines

Sub merge()
If Not IsEmpty(Sheets("Sheet2").Range("A1").Value) Then
Select Case Sheets("Sheet2").Range("A1").Value
Case Is = 1
Sheets("Sheet1").OptionButton4 = True
Case Is = 0
Sheets("Sheet1").OptionButton3 = True
End Select
End If
End Sub

Mike

"ac1179" wrote:

Hello,

I created two radio buttons on a spreadsheet where a user can select
one button for Yes and the other for No. When I right click these
buttons, I notice the names (shown on the left hand side of the
formula bar) a

Option Button 3 (for No)
Option Button 4 (for Yes)


I'd like to create a macro that automatically selects the Yes or No
button depending on a cell value in another tab. If the cell value is
1, the macro should select Yes. If the value is 0 the macro should
select No.

How do I go about doing this?

Can someone help me out with some code?

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Selecting Radio Buttons by Using Macros

On Oct 17, 4:39*pm, Mike H wrote:
Hi,

maybe something along these lines

Sub merge()
If Not IsEmpty(Sheets("Sheet2").Range("A1").Value) Then
Select Case Sheets("Sheet2").Range("A1").Value
* * Case Is = 1
* * * * Sheets("Sheet1").OptionButton4 = True
* * Case Is = 0
* * * * Sheets("Sheet1").OptionButton3 = True
End Select
End If
End Sub

Mike



"ac1179" wrote:
Hello,


I created two radio buttons on a spreadsheet where a user can select
one button for Yes and the other for No. When I right click these
buttons, I notice the names (shown on the left hand side of the
formula bar) a


Option Button 3 (for No)
Option Button 4 (for Yes)


I'd like to create a macro that automatically selects the Yes or No
button depending on a cell value in another tab. *If the cell value is
1, the macro should select Yes. *If the value is 0 the macro should
select No.


How do I go about doing this?


Can someone help me out with some code?


Thanks!- Hide quoted text -


- Show quoted text -


Hey Mike,

I gave that a try, but the following error came up:

Run-time error 438
Object doesn't support this property or method

When I click debug, the text "Sheets("Sheet1").OptionButton4 = True"
was highlighted.

Any thoughts? Thanks again!
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
Radio buttons Pawan Excel Discussion (Misc queries) 0 November 18th 08 01:24 PM
Option Buttons/Radio Buttons John Calder New Users to Excel 7 May 16th 08 03:51 AM
radio Buttons Kev Excel Discussion (Misc queries) 1 June 18th 07 07:26 PM
Radio Buttons Darin Kramer Excel Programming 4 December 16th 04 01:16 PM
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True Mcasteel Excel Worksheet Functions 2 October 29th 04 07:06 PM


All times are GMT +1. The time now is 12:18 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"