Questions tagged [excel]

Only for questions on programming against Excel objects or files, or formula development. You may combine the Excel tag with VBA, VSTO, C#, VB.NET, PowerShell, OLE automation, and other programming related tags and questions if applicable. Do NOT use with other spreadsheet software like [google-sheets].

Microsoft Office Excel is a spreadsheet application written and distributed by Microsoft for Microsoft Windows and macOS. It features calculation, graphing tools, sorting and filtering data, pivot tables and a macro programming language called Visual Basic for Applications (VBA).

Languages and environments for programming against Excel include:

Questions tagged with should be version-agnostic. More specific tags include:

Version-specific tags include , , , , , , , , , ,

Microsoft Excel 2010 Microsoft Excel 2010 on Windows 7

More information

Useful resources

Official logo

Microsoft Excel official logo

Logo image source: https://products.office.com/en-au/products

281899 questions
16
votes
2 answers

Is there any .NET Core compatible library for reading excel spreadsheet file?

I need to parse xlsx file on Linux from .NET Core Console application. However, I couldn't find any library for parsing Microsoft Office files that is supported by .NET Core 5 framework.
Štěpán Beneš
  • 189
  • 1
  • 1
  • 4
16
votes
6 answers

Create excel chart using Apache POI

I need to create excel sheet from my Java code which contains charts like Bar chart, Line Chart etc using the Apache POI library. Is it possible? I am not able to find any useful code example for the same. Is there any other alternative for this…
javdev
  • 794
  • 2
  • 10
  • 23
16
votes
1 answer

Adding autofilter and sorting causes Excel to crash

I'm developing an application where you can export some data to an Excel file using OpenXML. Everything is working fine except with the autofilter. The idea is to add an autofilter to the main body of the data so that the user automatically has…
Matt Burland
  • 44,552
  • 18
  • 99
  • 171
16
votes
2 answers

How can Excel 2007 / 2010 consume a REST web service?

What options exist to consume a REST web service from within Excel 2007 / 2010? I can use XML Maps to consume a basic XML list, but that doesn't let me build a dynamic URL (so I could include parameters). For example, I can add an XML Map to Excel…
jallen
  • 161
  • 1
  • 1
  • 3
16
votes
1 answer

$ (dollar sign) equivalent for structured notation (Excel Worksheet table)

I'm basically looking for a $A:$A equivalent for structured table references in Excel. Say I have this formula: =INDEX(tChoice,MATCH(OFFSET(tData[@[cm_sex]],-3,0),tChoice[name],0),3) Basically tData is a table full of raw data (many columns), taken…
logicOnAbstractions
  • 2,178
  • 4
  • 25
  • 37
16
votes
1 answer

Using str.contains on pandas dataframe

This pandas python code generates the error message, "TypeError: bad operand type for unary ~: 'float'" I have no idea why because I'm trying to manipulate a str…
Davtho1983
  • 3,827
  • 8
  • 54
  • 105
16
votes
4 answers

Pad single-digit numbers with a zero

I have a loop like this to save sheets as CSV files but my first 9 sheets are name liked sinani-01 ... sinani-09 (not like sinani-1 ... sinani-9). How I can concatenate a 0 only before numbers less than 10? Sub Adder() Dim animal As String …
Suffii
  • 5,694
  • 15
  • 55
  • 92
16
votes
9 answers

Expanding column cells for each column cell

I have 3 different sets of data (in different columns) Animals (5 different kinds) in column A Fruits (1000 different kinds) in column B Countries (10 different kinds) in column C With these 3 data collections I would like to receive…
mysticous
  • 179
  • 2
  • 10
16
votes
2 answers

ClosedXML - Creating multiple pivot tables

I am trying to export some data to an excel sheet S1 whose data would be shown as Pivoted views in the next two sheets S2 and S3. I am able to create a single pivot and it works perfect. But when I create two pivots, the consequent Excel file…
Nikhil Girraj
  • 1,135
  • 1
  • 15
  • 33
16
votes
2 answers

Bold and Italics not working in excel with EPPLUS

I am using the below code for updating excel data format, here I want the heading to be in bold and entire data in italics format but when I run the code all the features in it seems to be working fine except for Bold and Italics. Code also…
Ash1994
  • 247
  • 1
  • 5
  • 16
16
votes
3 answers

AVERAGEIF(range, criteria) formula that ignores errors in the data

How do you specify the criteria if you want to average a range of numbers but want to ignore errors using the AVERAGEIF() function? For example, given the data below: A1: 1 A2: #DIV/0! A3: #VALUE! A4: 5 A5: 0 Wanting to use the AVERAGEIF(range,…
ciso
  • 2,887
  • 6
  • 33
  • 58
16
votes
10 answers

How to select the contents of a textbox once it is activated?

I have this simple Userform, where I only have TextBox1 and TextBox2. I enter some text in both of them. Assume the focus is on (the cursor is in) the TextBox2. When I click on TextBox1, I want the whole text in this control to be highlighted…
ZygD
  • 22,092
  • 39
  • 79
  • 102
16
votes
7 answers

Create a hyperlink to a different Excel sheet in the same workbook

I'm using the module openpyxl for Python and am trying to create a hyperlink that will take me to a different tab in the same Excel workbook. Doing something similar to the following creates the hyperlink; however, when I click on it, it tells me it…
user2869231
  • 1,431
  • 5
  • 24
  • 53
16
votes
6 answers

Get start range and end range of a vertically merged cell with Excel using VBA

I need to find out the first cell and the last cell of a vertically merged cell.. Let's say I merge Cells B2 down to B50. How can I get in VBA the start cell(=B2) and the end cell(=B50)?
vbauser
  • 161
  • 1
  • 1
  • 3
16
votes
6 answers

Getting "method saveas of object _workbook failed" error while trying to save an XLSM as CSV

I'm trying to save a macro-enabled Excel workbook as a csv file, overwriting the old one (below I had to change the name of the folder and the Sheet, but that doesn't seem to be the issue). Sub SaveWorksheetsAsCsv() Dim SaveToDirectory As String …
Riccardo
  • 337
  • 1
  • 2
  • 7
1 2 3
99
100