MrExcel Publishing
Your One Stop for Excel Tips & Solutions

How can i use ListFillRange function if i want to give a variable rather than the column name..


Posted by Adnan Badar on February 04, 2002 1:11 AM

How can i use ListFillRange function if i want to give a variable rather than the column name.

for example i want to retrieve vlues from another sheet whose name is positions and in column A i put values when i apply like

ComboBox1.ListFillRange = "Positions!$A$2:$A$7"

it's working proprely but i want to use variables rather than 2 or 7 cuz my values in column A increase again and again due to my project requirement.

can anybody tell me how can i do this ....

if u have any kind of idea then plz advice


Posted by Juan Pablo G. on February 04, 2002 6:52 AM

ListFillRange is a string, therefor, you can concatenate to produce what you want. Something like:

ComboBox1.ListFillRange = "Positions!$A$" & Var1 & ":$A$" & Var2

Where Var1 equals 2 and Var2 equals 7.

Juan Pablo G.