Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default populating list

How do I find out how many entries I have in a column, when the column length
is changing all the time? I would like to populate a combobox with entries
in a column, but I am constantly adding to the column.

wazooli
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default populating list

You could use a dynamic range. Debra Dalgleish has some notes at:
http://www.contextures.com/xlNames01.html#Dynamic

Or maybe determine the range when you need it:

dim myRng as range
with worksheets("Sheet1")
set myrng = .range("a1", .cells(.rows.count,"A").end(xlup))
end with



Wazooli wrote:

How do I find out how many entries I have in a column, when the column length
is changing all the time? I would like to populate a combobox with entries
in a column, but I am constantly adding to the column.

wazooli


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default populating list

What I use is a simple excel function to count the populated cells. Use
something like:
=100-COUNTBLANK(A1:A101)
adjust that to whatever cell range you are using and then reference that
cell in the for loop when populating the combobox.


"Wazooli" wrote:

How do I find out how many entries I have in a column, when the column length
is changing all the time? I would like to populate a combobox with entries
in a column, but I am constantly adding to the column.

wazooli

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default populating list

Thanks Dave - I'll try that. Is this going to get screwed up if some of the
cells are merged? I have merged rows separating years..."1999", "2000", etc.


"Dave Peterson" wrote:

You could use a dynamic range. Debra Dalgleish has some notes at:
http://www.contextures.com/xlNames01.html#Dynamic

Or maybe determine the range when you need it:

dim myRng as range
with worksheets("Sheet1")
set myrng = .range("a1", .cells(.rows.count,"A").end(xlup))
end with



Wazooli wrote:

How do I find out how many entries I have in a column, when the column length
is changing all the time? I would like to populate a combobox with entries
in a column, but I am constantly adding to the column.

wazooli


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default populating list

The only way I know to check to see if merged cells screw things up is to test
it.

What happened when you tried it?

Wazooli wrote:

Thanks Dave - I'll try that. Is this going to get screwed up if some of the
cells are merged? I have merged rows separating years..."1999", "2000", etc.


"Dave Peterson" wrote:

You could use a dynamic range. Debra Dalgleish has some notes at:
http://www.contextures.com/xlNames01.html#Dynamic

Or maybe determine the range when you need it:

dim myRng as range
with worksheets("Sheet1")
set myrng = .range("a1", .cells(.rows.count,"A").end(xlup))
end with



Wazooli wrote:

How do I find out how many entries I have in a column, when the column length
is changing all the time? I would like to populate a combobox with entries
in a column, but I am constantly adding to the column.

wazooli


--

Dave Peterson


--

Dave Peterson
Reply
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
populating list and formatting Matt Excel Discussion (Misc queries) 1 March 17th 10 08:25 PM
drop down list populating Pammy Excel Discussion (Misc queries) 2 October 27th 08 04:25 PM
.AddItem list and populating combobox with created list pallaver Excel Discussion (Misc queries) 8 June 27th 08 12:36 PM
Populating dropdown list 2 with data depending upon what was selected in list 1 karambos Excel Programming 2 November 9th 04 05:32 PM
Populating a Validation List with SQL Rone Excel Programming 1 May 15th 04 04:26 AM


All times are GMT +1. The time now is 10:32 PM.

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

About Us

"It's about Microsoft Excel"