Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8753551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:26:54+00:00 2026-06-13T13:26:54+00:00

How do you insert selected radio values into a Excel spreadsheet from a VBA

  • 0

How do you insert selected radio values into a Excel spreadsheet from a VBA form? By radio values we mean that there only one possible option. I’m struggling to achieve this in VBA.


Here are my radio values:

priority – options located in the frame fr_Priority, two possible checkbox options:

  • priority_y – If user selects this then Yes is inserted into cell

  • priority_n – If user selects this then No is inserted into cell

lectureStyle – options located in the frame fr_LectureStyle, two possible checkbox options:

  • lecturestyle_trad – If user selects this then Traditional is inserted into cell

  • lecturestyle_sem – If user selects this then Seminar is inserted into cell

  • lecturestyle_lab – If user selects this then Lab is inserted into cell

  • lecturestyle_any – If user selects this then Any is inserted into cell

roomStructure – options located in the frame fr_roomStruc, two possible checkbox options:

  • rs_Tiered – If user selects this then Tiered is inserted into cell

  • rs_Flat – If user selects this then Flat is inserted into cell


Here is my code so far:

Private Sub btnSubmit_Click()
Dim ws As Worksheet, rng1 As Range
Set ws = Worksheets("main")

' Get last empty cell in column A
  Set rng1 = ws.Cells(Rows.Count, "a").End(xlUp)

' I'm strugging to insert the radio values inserted at this point, they 
' need to go into the cells specified below

' rng1.Offset(1, 10) = priority
' rng1.Offset(1, 11) = lectureStyle
' rng1.Offset(1, 12) = roomStructure

End Sub

Thanks so much for the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:26:56+00:00Added an answer on June 13, 2026 at 1:26 pm

    To me it just seems like you need to do some validation on your radio box’s values, here is one way you could do it

    Private Sub btnSubmit_Click()
    
        Dim ws As Worksheet, rng1 As Range
        Set ws = Worksheets("main")
    
        'Get last empty cell in column A
        Set rng1 = ws.Cells(Rows.Count, "a").End(xlUp)
    
        ' I'm strugging to insert the radio values inserted at this point, they
        ' need to go into the cells specified below
    
        rng1.Offset(1, 10) = GetPriority
    
    End Sub
    
    Private Function GetPriority() As String
    
        Dim priority As String
        If Me.priority_y.Value = True Then
            priority = "Yes"
        ElseIf Me.priority_n.Value = True Then
            priority = "No"
        Else
            priority = "N/A"
        End If
        GetPriority = priority
    
    End Function
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write a script to insert data selected from one table into
I am trying to insert values into selected columns of table, but only insert
Need to insert selected text on the page into textarea. There must be some
I am trying to insert a list of selected checkboxes into a spreadsheet, within
I need to insert the selected data from tblA to tblB only if data
I want to insert multiple selected values into database in listbox. I am using
I'm trying to insert variables from an SQL result into a HTML form in
I am Developing Windows Form Application in .Net, I want to insert selected rows
INSERT INTO [Temp].[dbo].[Student] ([Fname], [Lname], [Gender]) VALUES (N'Aname', N'Alname', N'Male') GO This codes workes
INSERT INTO options (owner, name, value, modified) SELECT owner, name, value, modified, @draft:=draft FROM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.