Code Modification

  • Thread starter Todd Huttenstine
  • Start date
T

Todd Huttenstine

ComboBox5.RowSource = "OFFSET(" & Worksheets(8).Name & "!
Y4,,,COUNTA(" & Worksheets(8).Name & "!Y:Y))"

The above code populates Combobox5 with values from a
specific column starting with cell 4. Currently Combobox5
is being populated with data from Column Y starting in
Row4. However the column it pulls data from will not
always be Column Y, so I need for this code to be
dynamic. I will need Combobox5 to reference a cell(cell
W4) that contains the actual column to populate data
from. The starting cell will still be and always be 4.

For example lets say the value in cell W4 is AL. This
means the combobox needs to populate data from this Column.

How do I do this?

Thank you
Todd Huttenstine
 
T

Tom Ogilvy

ComboBox5.RowSource = "OFFSET(" & Worksheets(8).Name & "!" _
& Range("W4").Value & ",,,COUNTA(" & Worksheets(8).Name & "!" _
& Range("W4").Value & ":" & Range("W4").Value & "))"
 

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