+ Reply to Thread
Results 1 to 4 of 4

Display 1 or 0 based on Checkbox selection - On Radio Button Click

  1. #1
    Registered User
    Join Date
    11-22-2011
    Location
    Noida
    MS-Off Ver
    Microsoft 365 MSO (16.0.13......) 32 bit
    Posts
    40

    Exclamation Display 1 or 0 based on Checkbox selection - On Radio Button Click

    Hello Experts,

    I am working on a Data Analysis.
    I have two worksheets named "Input Sheet" and "Data".
    In Input sheet, I have 30 checkboxes which reflects if those 30 products are offered or not.
    If Checkbox 1 is checked, it would mean Product X is offered.
    Action required -
    1. User will fill the Input sheet where I have checkboxes (check or unckeck) and then he will click radio button "Export Data".

    2. A message box will be displayed - Do you confirm data export - Yes or No
    a) If "Yes", export data and if "No", message box will disappear and it allows user to check his entries again.

    3. On clicking this export data -
    a) If in worksheet named "Input Sheet", user checks Checkbox1 for Product X, in other worksheet named "Data", change the value of cell $B$10 to 1; Else if it is unchecked then $B$10 should set to 0.
    b) Similarly for Checkbox 2 map to WS Data C10, Checkbox 3 map to D10, Checkbox 4 map to E10 etc

    Tricky part here is if User fills Input Sheet and export this by clicking on Export Data button, it should start filling data starting from Row 10 of Worksheet "Data". (Row 1 to 9 - I am using for some other representation).
    Once the Export of data is done, reset all checkbox to unchecked.
    If another user use the same file to fill data in worksheet "Input Sheet", this time when Button "Export Data" is Clicked, it should start exporting data in next row i.e. Row 11 and so on.

    Request you to please provide VBA code for this exercise. I can understand that part of this module is possible with Form Control, but I wanted this to be implemented by Active X Control.
    Also, please guide me if for this I have to assign macro on Radio Button or Input Sheet -> View Code.

    Using Internet, I started with following sub module of code required. But even this gives an error.
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Display 1 or 0 based on Checkbox selection - On Radio Button Click

    You have ended the IF block, then done an else if

    remove the else from the ELSEIF
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    11-22-2011
    Location
    Noida
    MS-Off Ver
    Microsoft 365 MSO (16.0.13......) 32 bit
    Posts
    40

    Re: Display 1 or 0 based on Checkbox selection - On Radio Button Click

    If I remove the Else from ElseIF statement how the fourth condition will be checked ?
    I mean how this condition will be checked.
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Display 1 or 0 based on Checkbox selection - On Radio Button Click

    I said remove the ELse from else if, so like this

    Please Login or Register  to view this content.
    You can use elseifs, but cant end the if block before.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy text to clipboard based on CheckBox value on Command Button click
    By askpcguy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2014, 01:21 AM
  2. [SOLVED] Trying to setup a filter based on Radio button Selection for the month
    By RaulRodriguez in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-12-2013, 09:35 AM
  3. Auto Hide/Unhide rows in Excel based on radio button selection
    By awill110 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2013, 03:05 PM
  4. [SOLVED] Swap out text in text box based on radio button selection
    By gordco in forum Excel General
    Replies: 2
    Last Post: 12-13-2012, 11:49 AM
  5. checkbox / radio button or combo-box???
    By ko6ad in forum Excel General
    Replies: 1
    Last Post: 02-11-2006, 10:40 AM

Tags for this Thread

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