+ Reply to Thread
Results 1 to 6 of 6

Option button (active control) code to perform a calculation

  1. #1
    Registered User
    Join Date
    11-18-2008
    Location
    Jersey
    Posts
    4

    Option button (active control) code to perform a calculation

    Option button (active control) code to perform a calculation on a cell reference
    Hi, is it possible to choose an option button which will then perform a calculation on a cell reference? I’m trying to deduct a percentage from a total when an option button is highlighted.
    I’m very new to vb, I can master how to enter details into the cell but that is all. Any help would be most appreciated.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Taggsuk,

    Welcome to the Forum!

    When you say "active control" are you referring to a Forms Toolbar control or an ActiveX control, which is the same as a Control Toolbox control or are uncertain which type of control to use?

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    11-18-2008
    Location
    Jersey
    Posts
    4
    Hi Leith,
    I'm using an option button (activex control) and all I have managed is to is select a cell and enter details ie

    Please Login or Register  to view this content.
    But I would really like to be able to perform a calculation on a referenced cell when the option box is clicked. So if the you clicked the option box named 50% then 50% would be deducted from the cell with the toal calculation in it.

    Thanks for the quick response
    Last edited by VBA Noob; 11-18-2008 at 04:10 PM. Reason: Added code tags as per forum rules

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Taggsuk,

    You need to use the OptionButton1_Change() event to determine the state of the OptionButton, not the default OptionButton1_Click() event.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Taggsuk,

    Please read forum rules below before posting again. I've added you're code tags for you this time

    Many thanks

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Registered User
    Join Date
    11-18-2008
    Location
    Jersey
    Posts
    4
    Thank you very much, works a treat

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1