RowSource Problem

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
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
 
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.
 
Back
Top