Questions tagged [excel-tables]

Questions dealing with structured (aka ListObject) tables in Excel-Formula and Excel-VBA. Should be reserved for questions involving the special syntax of Structured Table References.

Questions dealing with structured (aka ListObject) tables in Excel-Formula and Excel-VBA. Should be reserved for questions involving the special syntax of Structured Table References.

324 questions
46
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
  • 545
  • 1
  • 6
  • 13
14
votes
5 answers

How to create Excel **Table** with pandas.to_excel()?

Need the achieve this programmatically from a dataframe: https://learn.microsoft.com/en-us/power-bi/service-admin-troubleshoot-excel-workbook-data
simpatico
  • 10,709
  • 20
  • 81
  • 126
13
votes
3 answers

VBA for selecting a number of columns in an excel table

As I learned here (also quoted in SO) the following code can be used to select the data-body of column 3 in Table1: ActiveSheet.ListObjects("Table1").ListColumns(3).DataBodyRange.Select I need help to select a number of columns together - say…
eli-k
  • 10,898
  • 11
  • 40
  • 44
10
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
  • 16,917
  • 5
  • 64
  • 88
6
votes
4 answers

Openpyxl created excel file with table causes file that requires recovery error

I have been testing adding a table to a worksheet using openpyxl, but I get the error below when I try to open it. The file opens, but the formatting isn't correct. After hitting recover, excel reports that there was an issue with the table xml. Is…
1QuickQuestion
  • 729
  • 2
  • 9
  • 25
4
votes
4 answers

Get the Listobject Range without the Sheet Specification

I have multiple tables in the workbook in different sheets. All the tables scope is Workbook as can be seen in the pic. Using VBA, is there a way to get this object assign to a ListObject variable without defining the SheetName?
Arya
  • 326
  • 2
  • 8
4
votes
1 answer

How Can I Enable Sorting/Filtering on XSSFTable Columns Using Apache POI?

I'm working on an application that fetches database records and creates an excel doc from that data. The excel doc is generated fine and all the data is readable; as of a previous answer from this forum the table is also appropriately generated (the…
Wickerbough
  • 365
  • 1
  • 4
  • 15
3
votes
2 answers

Convert the formula dynamically to populate the data in Listobject Loops using VBA

I have 6 different Excel tables in a single worksheet with similar column names and I would like to implement 1 formula in one of the columns in all these tables. I would like to populate the Sequence numbers (in the "Sequence" Columns) based on the…
mrk777
  • 117
  • 1
  • 12
3
votes
2 answers

Vba Number Format for only Totals Calculation for ListObject

I want to create a custom currency number format only in the total row table if there is a solution and which I mark the yellow color in the screenshot. Thanks jack Sub test2() Dim objListObj As ListObject Set objListObj =…
roy
  • 693
  • 2
  • 11
3
votes
2 answers

How to efficiently import multiple excel tables located in one sheet into an R list?

Task I am trying to import tables situated in a single excel sheet into an R object as efficiently as possible (list will be fine, as I can take the rest of the calculations from there). Nuance The tables are actually excel ranges not excel tables,…
Vitali Avagyan
  • 1,193
  • 1
  • 7
  • 17
3
votes
3 answers

How can I programmatically add rows to existing Excel table with Python

Despite the various Python Excel-manipulation libraries and resources, I am unable to find a specific solution. Right now, I have a template Excel file where a table exists. I would like to write a Python program in order to populate this table. Is…
Vagos Duke
  • 331
  • 2
  • 11
3
votes
4 answers

How to refer to a structured table without referring to its sheet in VBA

In VBA I know that I can refer to a structured table via this way: Set Tbl = Sheets("MySheetName").ListObjects("MyTblName") Then do Tbl.XXX where .XXX can be .Name, .Range, etc. However, I want to refer to this table without referring to the…
Lun
  • 428
  • 4
  • 20
3
votes
2 answers

Average ifs with or in excel

So, I have this problem, I would like to find the average of a column by using the OR function to check criteria from adjusted columns, I tried putting OR into AverageIf function, fail, also tried the "Average(IF(OR(" again not the correct return.…
elv
  • 85
  • 6
3
votes
2 answers

Referencing specific Range of table's .DataBodyRange

Let's say I have the following exemplary table I have a for loop that runs through the entire ListColumn(2) (column C / 3) and ranks the "users" based on who has the most apples (eg. Michael would be 1, Robert 2, etc.) However let's say, I want to…
Samuel Hulla
  • 6,617
  • 7
  • 36
  • 70
3
votes
1 answer

Dynamically expand an excel table based on entries in another table

I'm setting up a spreadsheet with the goal of allowing users to enter data by employee and date. I'd like to create a dynamic table that expands based on entries into another table. E.g., can I automatically expand TABLE1 based on new employees…
John
  • 802
  • 2
  • 9
  • 19
1
2 3
21 22