tqm1
05-07-2007, 11:11 PM
Dear Experts
When I load userform, it shows following error message
Run Time error 1004
Select method of range class failed
May there is some worong in
Sub Load_Last_Entry()
Dim LastRow As Long
Sheets("Table").Cells(1, 1).Select
LastRow = Range("A65536").End(xlUp).Row 'find the last entry in Col A
MsgBox (Str(LastRow))
If LastRow > 1 Then
Me.TextBox1.Value = Sheets("Table").Cells(LastRow, 1).Value
Me.TextBox2.Value = Sheets("Table").Cells(LastRow, 2).Value
'.....
'.....
'.....
CurrentRow = LastRow
Sheets("Table").Cells(CurrentRow, 1).Select
End If
End Sub
The attachment is excel file, please reveiw and help to get rid of error message.
Thanks
When I load userform, it shows following error message
Run Time error 1004
Select method of range class failed
May there is some worong in
Sub Load_Last_Entry()
Dim LastRow As Long
Sheets("Table").Cells(1, 1).Select
LastRow = Range("A65536").End(xlUp).Row 'find the last entry in Col A
MsgBox (Str(LastRow))
If LastRow > 1 Then
Me.TextBox1.Value = Sheets("Table").Cells(LastRow, 1).Value
Me.TextBox2.Value = Sheets("Table").Cells(LastRow, 2).Value
'.....
'.....
'.....
CurrentRow = LastRow
Sheets("Table").Cells(CurrentRow, 1).Select
End If
End Sub
The attachment is excel file, please reveiw and help to get rid of error message.
Thanks