MrExcel Publishing
Your One Stop for Excel Tips & Solutions

If functions

Posted by M Walker on July 27, 2001 8:08 AM


I'm a complete beginer when it comes to VBA but i'd like to be able to fill a list box with information depending on the value of a cell. From reading the previous entries that could be useful an if function seems to be the way to go but i'm stuck. I don't know the syntax or code that would allow me to check a range of cells and if that cell has a certain value in it place informatio in a list box on a user form. Can anybody help me please?


Posted by Sarah on July 27, 2001 11:15 AM

Hi Matt,
I think you're looking for something along this lines:

If (Range("A1").Value = 0) Then
ListBox1.RowSource = "Sheet1!B1:B10"
End If

Hope this helps,