sakthi santhanam
New Member
Code:
Private Sub CommandButton1_Click()
Dim lw As Long
Dim m As Long
Dim rnglast As Range
lw = Sheet1.UsedRange.Rows.Count + 1
Set rnglast = Sheet1.Range("A7:A" & lw).Find(Sheet1.ComboBox1.Value, ActiveCell, xlValues, xlWhole, xlByRows, xlNext, False)
Sheet1.Range("A" & rnglast.Row).EntireRow.Insert
End Sub
Here the error occurs Object variable or without block variable not set....
I tried this code to check rnglast gets any value or not....
Code:
if not rnglast is nothing then
msgbox "True"
else
msgbox "False"
end if
For the First time my code was working fine but after I closed and reopened I am getting this error.....
My objective is to find the value from the column range and by row no using "rnglast.row" I will get the row no.
Please do help me...
Sakthi