G
Guest
Guest
Hi all
Sub WriteTable(SheetName As String, Details As FormDetail)
Dim DBTableLocation As Object, LastCell As Range
Worksheets(SheetName).Activate
' Find the last cell in a column
LastCell = Range("A65536").End(xlUp).Select
With LastCell
.FormulaR1C1 = Details.AccountNumber
.Offset(0, 1).FormulaR1C1 = Details.Bucket
.Offset(0, 2).FormulaR1C1 = Details.Claimable
.Offset(0, 3).FormulaR1C1 = Details.CollectAmount
.Offset(0, 4).FormulaR1C1 = Details.PushBack
.Offset(0, 5).FormulaR1C1 = Details.SV_Code
.Offset(0, 6).FormulaR1C1 = Details.SV_Name
End With
End Sub
When I run the code.. I get LastCell object not set. What's wrong with the code??
Sub WriteTable(SheetName As String, Details As FormDetail)
Dim DBTableLocation As Object, LastCell As Range
Worksheets(SheetName).Activate
' Find the last cell in a column
LastCell = Range("A65536").End(xlUp).Select
With LastCell
.FormulaR1C1 = Details.AccountNumber
.Offset(0, 1).FormulaR1C1 = Details.Bucket
.Offset(0, 2).FormulaR1C1 = Details.Claimable
.Offset(0, 3).FormulaR1C1 = Details.CollectAmount
.Offset(0, 4).FormulaR1C1 = Details.PushBack
.Offset(0, 5).FormulaR1C1 = Details.SV_Code
.Offset(0, 6).FormulaR1C1 = Details.SV_Name
End With
End Sub
When I run the code.. I get LastCell object not set. What's wrong with the code??