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 8756637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:07:42+00:00 2026-06-13T14:07:42+00:00

I would like to insert data from three different drop downs into my spreadsheet

  • 0

I would like to insert data from three different drop downs into my spreadsheet but I am having several difficulties. There are three drop downs called cbo_fac1, cbo_fac2 and cbo_fac3.


Here are the use cases:

Use case 1 – Results in No preference being inserted into spreadsheet

cbo_fac1 - No preference
cbo_fac2 - No preference 
cbo_fac3 - No preference 

Use case 2a – Results in value, , being inserted into spreadsheet. Should just be value

cbo_fac1 - Value
cbo_fac2 - No preference
cbo_fac3 - No preference 

Use case 2b – Results in , value, being inserted into spreadsheet. Should just be value

cbo_fac1 - No preference
cbo_fac2 - Value
cbo_fac3 - No preference

Use case 2c – Results in , , value being inserted into spreadsheet. Should just be value

cbo_fac1 - No preference 
cbo_fac2 - No preference 
cbo_fac3 - Value

Use case 3a – Results in value, value, being inserted into spreadsheet. Should just be value, value

cbo_fac1 - Value
cbo_fac2 - Value 
cbo_fac3 - No preference

Use case 3b – Results in , value, value being inserted into spreadsheet. Should just be value, value

cbo_fac1 - No preference
cbo_fac2 - Value 
cbo_fac3 - Value  

Use case 3c – Results in value, , value being inserted into spreadsheet. Should just be value, value

cbo_fac1 - Value
cbo_fac2 - No preference
cbo_fac3 - Value      

How do I remove the extra commas in Use cases 2a-3c?

Here is my code so far:

If Me.cbo_fac1 <> "No preference" Then
cbo_fac1Entry = Me.cbo_fac1.Value
Else
cbo_fac1Entry = ""
End If

If Me.cbo_fac2 <> "No preference" Then
cbo_fac2Entry = Me.cbo_fac2.Value
Else
cbo_fac2Entry = ""
End If

If Me.cbo_fac3 <> "No preference" Then
cbo_fac3Entry = Me.cbo_fac3.Value
Else
cbo_fac3Entry = ""
End If

cbo_facEntry = cbo_fac1Entry & ", " & cbo_fac2Entry & ", " & cbo_fac3Entry

If cbo_facEntry = " , ," Then
cbo_facEntry = "No preference"
Else
End If
rng1.Offset(1, 15) = cbo_facEntry

I’ve tried inserting this code:

if right(cbo_facEntry,1)="," then
   cbo_facEntry= left(len(cbo_facEntry)-1)
end if

if left(cbo_facEntry,1)="," then
   cbo_facEntry= right(len(cbo_facEntry)-1)
end if

After:

If cbo_facEntry = ",," Then
cbo_facEntry = "No Preference"
Else
End If

But it doesn’t make much difference, as it doesn’t fulfil the requirements of all the use cases and also returns an invalid syntax error message.


Thanks in advance!

  • 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-13T14:07:43+00:00Added an answer on June 13, 2026 at 2:07 pm

    You can add these three lines to your code instead of what you’ve tried:

    cbo_facEntry = Replace(cbo_facEntry, ", , ", ", ")
    If Left(cbo_facEntry, 1) = "," Then cbo_facEntry = Right(cbo_facEntry, Len(cbo_facEntry) - 2)
    If Right(cbo_facEntry, 2) = ", " Then cbo_facEntry = Left(cbo_facEntry, Len(cbo_facEntry) - 2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to insert data from table1 into table2. However, I would like to
I have a JPA project and I would like to insert some initial data
I would like to insert the output of multiple calculations into my text document:
I would like to insert a new DataGridViewRow into my DataGridView at a specific
I have three mysql tables that I would like to extract some information from,
I am trying to retrieve particular data from a txt file and would like
I'm building something like in the question How to collect data from different .a
I would like to insert the current Subversion revision number (as reported by svnversion
I would like to insert dates in an emacs buffer like I do in
I would like to insert notes on the fixes to be done in specific

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.