+ Reply to Thread
Results 1 to 4 of 4

"IF" function in VB

  1. #1
    Registered User
    Join Date
    08-01-2007
    Posts
    13

    "IF" function in VB

    Hey!

    I was hoping, as ever, to get some advice?

    I've created a spreadsheet that displays all the information by default and then the user narrows down the data to whats relevant by clicking radio buttons. For the first level of options (Option1) I can do this. Where I get stuck is trying to hide data with Option2 depending what was pressed in Option1

    For example in Option1 you can have either A or B

    In Option2 you can have C or D but the data shown is relevant to whether A or B was selected in Option1

    I gather I need an "IF" function i.e:
    IF A = true then...
    IF A and C = true then...
    but I can't work out the wording, please help!

    Much appreciated,

    James

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    here is a couple of different ways

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Registered User
    Join Date
    08-01-2007
    Posts
    13
    Thanks mudraker, this looks like what I'm after, but how do I make the statements relate to a button?
    i.e.
    If "button A" = True Then

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Assuming you have used the Control Toolbox Option buttons then

    something like this

    Please Login or Register  to view this content.
    If this does not help you it would be best if you could post a copy of your workbook

+ 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