Hello All and thank you for any help you may be able to offer in advance. The code I've placed below is called from a macro on a different sheet (Framing Tool) and is meant to first determine the size of a list, make that list into a range, and then place the range as the options in a listbox. However the code is creating the range from the current sheet rather than WsOppDB and I cannot figure out why, any thoughts?
Also, I'm having trouble understanding the difference between .list and .rowsource.
Private Sub UserForm_Initialize()
Dim wsOppDB, wsframingtool As Worksheet
Dim OpprangeList As Range
Dim opprangenumber As Integer
Set wsOppDB = Sheets("OpportunitiesDB")
Set wsframingtool = Sheets("Framing Tool")
opprangenumber = Application.WorksheetFunction.CountA(wsOppDB.Range("C11:C500"))
With wsOppDB
Set OpprangeList = Range(Cells(11, 3), Cells(11 + opprangenumber - 1, 3))
End With
With OpportunityList
.List = OpprangeList.Value
End With
'MsgBox opprangenumber
End Sub
Bookmarks