2003 ObjectList Function adding column with formulae

jorgan202

New Member
Joined
Jun 23, 2015
Messages
20
I cannot seem to find anything to do with List , by the looks of it ObjectList function which help?

Code:
Dim srow As Long
    Range("CB2").Select
    ActiveSheet.ListObjects("List1").Unlist
        srow = ws.Range("CQ3" & ws.Rows.Count).End(xlUp).Row
        Set rngS = Range("CR3:cr" & srow)
        rngS.Select
        Selection.Insert = "=IF(ck3=1,$ck$2,IF(cl3=1,$cl$2,IF(cm3=1,$cm$2,IF(cn3=1,$cn$2,IF(co3=1,$co$2,IF _(cp3=1,$cp$2,IF(cq3=1,$cq$2,"")))))))"
    Range("CB2").Select
    ActiveSheet.ListObjects.Add(xlSrcRange, Range("$CB$2:$CR$" & srow), , xlYes).Name = "List1"

In the last column of the table I'm trying to add a formulae, whil;e it is in"List" mode can seem to do a thing, therefore removing the ObjectList and then trying to add the last column, but always a but, it doesn't like the following:

Code:
srow = ws.Range("CQ3" & ws.Rows.Count).End(xlUp).Row
and I can't figure it out??
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Try adopting the following code, which enters a formula for the last column...

Code:
    [COLOR=darkblue]With[/COLOR] Sheet1.ListObjects("List1")
        .ListColumns(.ListColumns.Count).DataBodyRange.Formula = "=[@ColumnHeaderName]*100"
    [COLOR=darkblue]End[/COLOR] [COLOR=darkblue]With[/COLOR]

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,662
Members
449,462
Latest member
Chislobog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top