AnswersAreEasy
New Member
- Joined
- Aug 18, 2016
- Messages
- 6
Hi, I've only been working with VBA for three hours so be a little patient.
I have a listbox on my worksheet "Main", and I want the options on this to update from a variable list (N3 - N*).
This is what I have right now for the code:
Private Sub ListBox10_Change()
Dim SeamRa As Object
Set SeamRa = Range("N3")
If Len(SeamRa.Formula) = 0 Then
Call SeamSort
Else
If Len(SeamRa.Formula) > 0 Then
.ListBox10.AddItem.SeamRa
SeamRa = SeamRa.Offset(1, 0)
End If
End If
End Sub
I'm getting an error that the Sub line is "Invalid or unqualified",
where I introduce the SeamRa object it says as an error "object rRange is undefined", even though I have no rRange object. And finally, where I add the SeamRa item to my list box, it says ListBox10 is undefined.
Additionally, this code is located on Module1. The listbox and range source are on the same sheet, but eventually I want to move the range source over to a different worksheet.
So far my coding has been going pretty well but I am completely stumped on this one.
Thanks you guys!
I have a listbox on my worksheet "Main", and I want the options on this to update from a variable list (N3 - N*).
This is what I have right now for the code:
Private Sub ListBox10_Change()
Dim SeamRa As Object
Set SeamRa = Range("N3")
If Len(SeamRa.Formula) = 0 Then
Call SeamSort
Else
If Len(SeamRa.Formula) > 0 Then
.ListBox10.AddItem.SeamRa
SeamRa = SeamRa.Offset(1, 0)
End If
End If
End Sub
I'm getting an error that the Sub line is "Invalid or unqualified",
where I introduce the SeamRa object it says as an error "object rRange is undefined", even though I have no rRange object. And finally, where I add the SeamRa item to my list box, it says ListBox10 is undefined.
Additionally, this code is located on Module1. The listbox and range source are on the same sheet, but eventually I want to move the range source over to a different worksheet.
So far my coding has been going pretty well but I am completely stumped on this one.
Thanks you guys!