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

  • Home
  • SEARCH
  • 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 7440241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:49:17+00:00 2026-05-29T10:49:17+00:00

Here is the set up, (all testing code) I have a combo box on

  • 0

Here is the set up, (all testing code)

I have a combo box on sheet one called “Devmod”

I have created a module called testing and with in it created the following sub

Sub setcomb()

    Sheet1.Devmod.ListFillRange = Range(Sheets("Device_info").Range("l3"), _
                      Sheets("Device_info").Range("l3").End(xlDown)).Select
End Sub

this runs OK but does not fill the combo box with any data (although it does select the right cells I want)

Now I know I can do this be creating a name range and then assigning this to the combo box.

but what I am trying to do is when the user click a “update button” each combo box is updated with the values entered.

In logical terms this would be

Select the range of cells from the Device_info sheet,
Start at cell L3 and work out the last cell used.
Assign these values to the combo box.

can I do this with one or two lines of code?

Cheers

DevilWAH

ANSWER
My simple function ends up as

    Function setcomblist(wsheet As String, startrng As String, Optional endrng As Variant)

'used to populate comboboxes from a dynamic lenth range taking named sheet and starting cell as argument.
'use: combobox.ListFillRange = setcombolist("sheetname", "startcell")

If IsMissing(endrng) Then

setcomblist = Range(Sheets(wsheet).Range(startrng), Sheets(wsheet).Range(startrng).End(xlDown)).Address(External:=True)

Else

setcomblist = Range(Sheets(wsheet).Range(startrng), Sheets(wsheet).Range(endrng)).Address(External:=True)
End If

End Function

Thanks agin for the help people

  • 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-05-29T10:49:18+00:00Added an answer on May 29, 2026 at 10:49 am

    ListFillRange is expecting a range address as a string. If you want to both select the range and assign it to the combo box you have to do that as two separate lines of code. Also, because your range of cells is on another worksheet, you need to give the range’s external address. (Otherwise the combo box will think you mean the range on it’s worksheet.)

    Sheet1.Devmod.ListFillRange = Range(Sheets("Device_info").Range("l3"), _
                      Sheets("Device_info").Range("l3").End(xlDown)).Address(External:=True)
    

    For clarity, I’d rewrite it as follows.

    Sub setcomb()
        Dim rng as Range
        Set rng = Sheets("Device_info").Range("L3")
        Sheet1.Devmod.ListFillRange = Range(rng, rng.End(xlDown)).Address(External:=True)
    End Sub
    

    On the other hand, you can also do this with a dynamic named range. I don’t recall how to create one off the top of my head, I’ll look it up and add it later.


    For a dynamic named range, enter something like this in Refers To.

    =OFFSET(Device_info!$L$3,0,0,COUNTA(Device_info!$L$3:$L$303),1)

    The COUNTA function needs to include the max number of rows you want to allow. The example above creates a dynamic named range that can grow up to 300 rows. And as my trusty ‘Excel Hacks‘ book says:

    When defining the range for COUNTA, resist the temptation to include
    an entire column of data so you do not force the COUNTA function to
    count potentially thousands of unnecessary cells.

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

Sidebar

Related Questions

Here is the problem from code chef : A set of N dignitaries have
I have the following code which is part of unit testing for serialization support
I have the following configuration set in my factories.yml file... all: mailer: param: transport:
How can i find all subsets of a set using c#? here set is
Here's the scenario: I have a set of buttons that I want to bind
Here's the situation: I have a label's text set, immediately followed by a response.redirect()
Here is pseudo-code of how I setup an array representing the MandelBrot set, yet
Here's my scenario: I have a simple stored procedure that removes a specific set
I created a sample application that where I have a basic fullscreensize UIImageView set
I have a set of points and each one has an area of influence

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.