Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2
This is the forum to discuss the Wrox book Excel 2007 VBA Programmer's Reference by John Green, Stephen Bullen, Rob Bovey, Michael Alexander; ISBN: 9780470046432
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 27th, 2009, 04:01 AM
Registered User
 
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Help on radio button code in excel vba

I have some 4 questions in excel which has radio buttons in it.
I am writing a vba code into it but its giving an error
i have this requirement
if option button 1 is clicked in Q1 i want it to range to cell which has question Q3
if option button 2 is clicked in Q1 i want it to range to cell which has question Q4
I am checking this code in Q2 option button click

Sub optionbutton2_click()
if optionbutton1.enabled=true then range("b3")
else if optionbutton2.enabled=true then range("b4")
End sub.

its giving me an error saying object is required
Can someone please help me on this.
  #2 (permalink)  
Old January 29th, 2009, 03:40 PM
Registered User
 
Join Date: Jan 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Salma, try this;

sub optionbutton1_click()
cells(3,"B").select
end sub

sub optionbutton2_click()
cells(4,"B").select
end sub

Last edited by Hammer; January 29th, 2009 at 04:04 PM.. Reason: previous response n/g


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a button with code into Excel hewstone999 Access VBA 0 March 18th, 2008 06:08 AM
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
ACCESS 2000 VBA CODE TO "SAVE AS" EXCEL ckentebe Access 0 May 25th, 2004 02:13 PM
Excel sometimes loses VBA code James Diamond Excel VBA 0 May 25th, 2004 03:43 AM
Button acts depending on radio button values janise Access 4 March 10th, 2004 12:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.