Questions tagged [listobject]

ListObject is a VBA object used for interacting with Excel. On the user interface it is called "Table". It organizes a range with some extra features to help you work with that range as being a table: easier expansion with new rows, calculated columns that automatically get formulas copied, formatting styles, etc.

ListObject documentation on MSDN

238 questions
35
votes
6 answers

How do I reference tables in Excel using VBA?

Is it possible in Excel VBA to reference a named table? Hypothetically this could be... Sheets("Sheet1").Table("A_Table").Select I have seen some mention of tables being a list object but I'm not sure if that is the same thing.
1212__Hello
  • 435
  • 1
  • 5
  • 13
9
votes
2 answers

Add/Modify/delete calculated column formula in Excel Listobject/Table via VBA

If I manually enter a formula into a column in an Excel table (i.e. ListObject), AutoCorrect applies this formula to the whole column. Is there any way to control the this behavior via VBA, i.e. can I somehow modify/delete/add this formula? I know I…
Peter Albert
  • 15,882
  • 4
  • 59
  • 83
8
votes
1 answer

Create Table in Excel Worksheet using VBA

I have this code below that will auto select a range. Does anyone know how I can add code to create a table to the selected range? Thanks! Sub DynamicRange() 'Best used when first column has value on last row and first row has a value in the last…
Jgonzales
  • 83
  • 1
  • 1
  • 4
7
votes
2 answers

Excel 2010, VBA and ListObjects subtotals not updating on Table changes

So, having this structure (starting at A1 - show snippet > run): table { border-color: #BBB; border-width: 0px 0px 1px 1px; border-style: dotted; } body { font: 12px Arial, Tahoma, Helvetica, FreeSans, sans-serif; color:…
Zenigata
  • 300
  • 1
  • 3
  • 11
5
votes
2 answers

Excel List-Object VBA Performance Bug?

I have an issue with performance on an excel application which uses List Objects (AKA Excel Tables). I suspect it may be a bug, but despite my Googling I could not find any reference of it. I've already developed a workaround for my application, but…
Skytunnel
  • 1,013
  • 1
  • 9
  • 17
5
votes
3 answers

How do I Append Multiple Rows from one Excel Table (ListObject) to Another?

I have two tables: Table_1 Table_2 A B C A B C ------------- ------------- 1| A1| B1| C1| 1| A2| B2| C2| 2| A1| B1| C1| 2| A2| B2| C2| 3| A1| B1| C1| 3| A2| B2| C2| Resulting table: Table_1 A B C …
user2271875
  • 315
  • 1
  • 3
  • 13
5
votes
2 answers

What is the proper way to insert values into an excel table using VBA?

I need to be able to insert a large set of values into an empty table in excel using VBA code. Here's how the code works so far. First, the user inputs a value into a userform. The code then clears the table then goes and finds a range of numbers…
Ashton Sheets
  • 513
  • 6
  • 12
  • 21
4
votes
2 answers

Importing an Excel Listobject into an Access table

I have an Access database with a table named InventoryAvail. I'd like to push a button in Access and import a specific Listobject from a specific Excel file to fill the InventoryAvail table. What vba code do I need to put on the button's event?…
Hawsidog
  • 111
  • 2
  • 12
4
votes
1 answer

Excel VBA - Storing table column into a range variable

I am currently experimenting with excel VBAs ListObjects which is the object type of an excel table. I would like to store a table column range into a variable. Here is what I can do: 'store a group of cells into a range variable dim rng as…
Axel
  • 1,603
  • 2
  • 13
  • 27
4
votes
1 answer

How to read formulas of Calculated Columns in an Excel Table/ListObject without any data rows

I have a ListObject with an external query as the data source, which returns 18 columns. The ListObject has previously had an additional 4 calculated columns added. Right now, the ListObject has 0 data rows, however, while there are 0 data rows, I…
ThunderFrame
  • 8,851
  • 2
  • 24
  • 53
4
votes
1 answer

How to write clear and maintainable code when dealing with tables?

In my projects I often take advantage of tables and underlying ListObjects and ListColumns. I like them as they're easier to reference and update than bare Range objects. Yet I still haven't found a sane and maintainable way to handle multiple…
browning0
  • 871
  • 2
  • 10
  • 21
4
votes
1 answer

CurrentRegion.SpecialCells(xlCellTypeVisible) too slow - Tips to Improve performance?

Im trying to automate a report that have 5 different information sources. Im trying to make a UNION of different tables into a single one using ListObjects, everything is working fine except when I copy the first column of the first ListObject. It…
4
votes
2 answers

Excel VBA: how to check for calculated column?

Is there anyway to check in VBA if a specific column of a table (ListObject) in Excel is a calculated column (as in http://office.microsoft.com/en-us/excel-help/use-calculated-columns-in-an-excel-table-HA010342380.aspx)? Note that calculated columns…
user1139216
  • 89
  • 1
  • 7
3
votes
1 answer

Open and Fetch data from a ListObject of an Excel sheet with Python

The Problem: Open a ListObject (excel table) of an Excel file from y python environment. The why: There are multiple solutions to open an excel file in python. Starting with pandas: import pandas as pd mysheetName="sheet1" df =…
JFerro
  • 1,861
  • 3
  • 21
  • 47
3
votes
1 answer

How can I obtain a subset of a ListObject's HeaderRowRange?

I'm trying to format all the cells in my ListObject's header row to the right of a certain cell, while leaving the ones to the left alone. When I started having trouble I reduced my code to this: Set rpt = Me.ListObjects("Report") With…
Lord Dust
  • 157
  • 9
1
2 3
15 16