Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


adding data to the bottom of my combobox.

Posted on 2003-02-19
Medium Priority
Last Modified: 2010-04-07
I have used the following code:

Sheets("INTERFACE").ComboBox1.ListFillRange = Sheets("Doctor Info").Range(Cells(1, 3), Cells(r, 3)).Address

INTERFACE sheet is where the combobox is located.  "Doctor Info" sheet is where I want the data in the combobox to come from.  The range is going from cell "C1" to cell "Cr" where r is the next empty cell.  I think the problem is with the Address property.  ListFillRange is getting the appropriate assignment (C1:Cr), but it's putting in the values of the "C" column from the "INTERFACE" sheet and not the "Doctor Info" sheet.  How can I get it to read from the C column on "Doctor Info" sheet?

Can anyone help?
Question by:bladidivach
  • 2

Accepted Solution

tgraffham earned 200 total points
ID: 7983014
The ListFillRange property accepts a string.  You're trying to set it to a Sheets object.

Try doing a little logic first to translate your:
    Sheets("Doctor Info").Range(Cells(1,3), Cells(r,3))

into the string:
    "'Doctor Info'!C1:C3'"

and then set ListFillRange property to that string.

I tested it and it worked fine.  However, you'll have to work out the logic for knowing what 'r' should be at each iteration of the code based on your particular situation.

Hope this helps.

Author Comment

ID: 7990501
I'm really not good at programming. How would I translate a range of cells from a referenced sheet into a string?


Author Comment

ID: 7990592
nevermind i figured out how to translate it.  that worked. thank you very much.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question