Hi All,
First time poster so please excuse any formatting issues and such.
I'm new to VBA but have been giving it a shot, I've become stuck after everything going so smoothly.
I'm getting the error message : [h=1]"Runtime Error 91: Object variable or with block variable not set"[/h]
Private Sub UserForm_Initialize()
Dim FlatValue1 As Range
PropVal = Sheets("INFO").Cells(41, 2).Value
FlatValue1 = Sheets("INFO").Cells(42, 2).Value
With Sheets("PROPS")
Set PropFoundValue1 = Sheets("PROPS").Range("A:A").Find(What:=PropVal.Value)
If PropValue1.Offset(0, 1).Value = FlatValue1 Then
RentTextBox.Text = PropValue1.Offset(0, 2)
StartDateTextBox.Text = PropValue1.Offset(0, 3)
TermStartDateTextBox.Text = PropValue1.Offset(0, 4)
RentDueTextBox.Text = PropValue1.Offset(0, 6)
DepositTextBox.Text = PropValue1.Offset(0, 7)
ElseIf PropValue1.Offset(1, 0) = PropVal And PropValue1.Offset(1, 1) = FlatValue1 Then
RentTextBox = PropValue1.Offset(1, 2)
StartDateTextBox = PropValue1.Offset(1, 3)
TermStartDateTextBox = PropValue1.Offset(1, 4)
RentDueTextBox = PropValue1.Offset(1, 6)
DepositTextBox = PropValue1.Offset(1, 7)
Else
MsgBox "Bug Found - Consult Rob"
End If
End With
With ComboBox1
.AddItem "Committed"
.AddItem "Managed"
.AddItem "Straight Let"
End With
With BreakClauseComboBox1
.AddItem "Yes"
.AddItem "No"
End With
End Sub
Any help is hugely appreciated! If you'd like me to upload the full excel I'd be happy to.
Kind Regards,
Rob.
First time poster so please excuse any formatting issues and such.
I'm new to VBA but have been giving it a shot, I've become stuck after everything going so smoothly.
I'm getting the error message : [h=1]"Runtime Error 91: Object variable or with block variable not set"[/h]
Private Sub UserForm_Initialize()
Dim FlatValue1 As Range
PropVal = Sheets("INFO").Cells(41, 2).Value
FlatValue1 = Sheets("INFO").Cells(42, 2).Value
With Sheets("PROPS")
Set PropFoundValue1 = Sheets("PROPS").Range("A:A").Find(What:=PropVal.Value)
If PropValue1.Offset(0, 1).Value = FlatValue1 Then
RentTextBox.Text = PropValue1.Offset(0, 2)
StartDateTextBox.Text = PropValue1.Offset(0, 3)
TermStartDateTextBox.Text = PropValue1.Offset(0, 4)
RentDueTextBox.Text = PropValue1.Offset(0, 6)
DepositTextBox.Text = PropValue1.Offset(0, 7)
ElseIf PropValue1.Offset(1, 0) = PropVal And PropValue1.Offset(1, 1) = FlatValue1 Then
RentTextBox = PropValue1.Offset(1, 2)
StartDateTextBox = PropValue1.Offset(1, 3)
TermStartDateTextBox = PropValue1.Offset(1, 4)
RentDueTextBox = PropValue1.Offset(1, 6)
DepositTextBox = PropValue1.Offset(1, 7)
Else
MsgBox "Bug Found - Consult Rob"
End If
End With
With ComboBox1
.AddItem "Committed"
.AddItem "Managed"
.AddItem "Straight Let"
End With
With BreakClauseComboBox1
.AddItem "Yes"
.AddItem "No"
End With
End Sub
Any help is hugely appreciated! If you'd like me to upload the full excel I'd be happy to.
Kind Regards,
Rob.