![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
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?? |
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Quote:
' Find the last cell in a column LastCell = Range("A65536").End(xlUp).Select to ' Find the last cell in a column LastCell = Range("A65536").End(xlUp) Regards,
__________________
Barrie Davidson "You're only given a little spark of madness. You mustn't lose it." - Robin Williams |
|
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
Hi Barrie,
Tried that, doesn't seem to work... when I am in break mode.. it says LastCell = nothing |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Set LastCell = Range("A65536").End(xlUp)
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Quote:
__________________
Barrie Davidson "You're only given a little spark of madness. You mustn't lose it." - Robin Williams |
|
|
|
|
|
|
#6 |
|
Guest
Posts: n/a
|
Thank you.... I am an idiot!!
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|