LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default user form VBA

I have a user form with combo boxes that draw the list from anothe
workbook. I use this code.

Private Sub UserForm_Initialize()
Dim wb As Workbook
Set wb = Workbooks.Open("f:\db1.xls")
For Each cell In wb.Sheets("Cust").Range("a2:A500")
Me.cboCust.AddItem cell.Value
Next cell
For Each cell In wb.Sheets("Subdiv").Range("a2:A500")
Me.cboSub.AddItem cell.Value
Next cell
wb.Close False


My problem is the .Range, instead of going to row 500, is ther
something I could do to make the list end at the last row used
regardless how long the list will becomes

--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
user form hngo New Users to Excel 2 July 13th 05 11:48 PM
user form static69 Excel Discussion (Misc queries) 1 February 6th 05 08:43 PM
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form BruceJ[_2_] Excel Programming 2 October 15th 03 05:28 PM
User Form SP Excel Programming 2 July 21st 03 11:34 PM


All times are GMT +1. The time now is 01:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"