LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Script works in forms element but doesn't in normal option button

Hello,

I'm programming a Macro to hide/unhide some entire rows and colums, but the
following proble occurs:

When I add the following script to the option button from controls, it
displays an error in line 3 (in the example marked with *):

Private Sub OptionButton1_Change()
If OptionButton1.Value = True Then
Sheets("Voorbeeldportefeuille").Select
*Columns("H:K").Select*
Selection.EntireColumn.Hidden = False
Else
Sheets("Invoer").Select
End If
End Sub

When I use the option button from the Forms toolbar, I get the following
script after recording the macro, and it works perfectly:

Sub Keuzerondje25_BijKlikken() (- = Sub
Optionbutton25_Click())
Sheets("Voorbeeldportefeuille").Select
Columns("H:K").Select
Selection.EntireColumn.Hidden = False
End Sub

Great that it works, but I want to use the option button from the controls
toolbar, as I need to use the change function, in stead of the click
function. Can anyone tell me what I'm doing wrong?

Thanks.




 
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
Insert comments on Option Button of Forms Toolbar Rechie Excel Discussion (Misc queries) 2 March 14th 10 11:26 AM
Option Button on Forms Toolbar admannj Excel Discussion (Misc queries) 4 January 25th 05 01:07 AM
RefEdits and normal forms / forms in a DLL David Welch Excel Programming 0 December 1st 04 03:49 PM
Option Button Macro (Forms Toolbar) AG[_5_] Excel Programming 3 July 16th 04 02:05 AM
Option Button and forms paradise Excel Programming 1 October 27th 03 12:32 PM


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