RowSource Problem

T

Todd Huttenstine

I am using the below code to populate combobox6 with
values from columnAG starting in row 3. In this row there
are 7 values(Range AG3:AG9) and everything below row 9 are
empty cells. This code populates the combobox with 7
values but it also is putting in alot of empty values.


ComboBox6.RowSource = "OFFSET(" & Worksheets(8).Name & "!
AG3,,,COUNTA(" & Worksheets(8).Name & "!AG:AC))"


How do I prevent it from showing empty values?

Todd Huttenstine
 
K

Kieran

Todd,

It looks like the COUNTA portion of your formula is counting too many
columns.

try

ComboBox6.RowSource = "OFFSET(" & Worksheets(8).Name & "!
AG3,,,COUNTA(" & Worksheets(8).Name & "!AG3:AG100))"


This may still have a problem, as COUNTA counts blanks. IF the cells
are empty hwever it should work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top