HI There,
I am trying the below code to use a dynamic range for lastfillrange in a combobox. It gives an error of Object variable not set
dont know what happened!! Can anyone help?
Private Sub ComboBox1_Change()
Dim lastrow As Long
Dim dyrange As Range
lastrow = Sheets("BG").Range("E7").End(xlUp).Row
dyrange = Sheets("BG").Range("E7:E" & lastrow)
ComboBox1.ListFillRange = dyrange
End Sub
I am trying the below code to use a dynamic range for lastfillrange in a combobox. It gives an error of Object variable not set
dont know what happened!! Can anyone help?
Private Sub ComboBox1_Change()
Dim lastrow As Long
Dim dyrange As Range
lastrow = Sheets("BG").Range("E7").End(xlUp).Row
dyrange = Sheets("BG").Range("E7:E" & lastrow)
ComboBox1.ListFillRange = dyrange
End Sub