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
136
votes
6 answers

How to convert Excel date format to proper date in R

I'm working with a csv which unfortunately has logged datetimes using the number format of 42705 although it should be 01/12/2016. I'd like to convert it to the right format in R using lubridate or some other package. Is there a function that will…
elksie5000
  • 7,084
  • 12
  • 57
  • 87
135
votes
8 answers

"The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine" Error in importing process of xlsx to a sql server

I have a 64 bit windows 7 and SQLServer 2008 R2 (64 bit) I follow the instructions that are here to import excel file to sql server but in figure3 section of that post when I try to access excel file and when I click next this error make me…
Mosijava
  • 3,941
  • 3
  • 27
  • 39
133
votes
6 answers

Remove leading or trailing spaces in an entire column of data

How do I remove leading or trailing spaces of all cells in an entire column? The worksheet's conventional Find and Replace (aka Ctrl+H) dialog is not solving the problem.
venkat
  • 5,648
  • 16
  • 58
  • 83
133
votes
4 answers

Display milliseconds in Excel

I am trying to display milliseconds in an Excel macro. I have a column of integers which are timestamps in milliseconds (e.g. 28095200 is 7:48:15.200 am), and I want to make a new column next to it which keeps a running average and displays the…
Evelyn
  • 2,588
  • 3
  • 22
  • 47
133
votes
9 answers

Working with time DURATION, not time of day

I'm doing some benchmarking, and I want to use Excel to produce graphs of the results. I've got a simple but annoying problem which is baking my noodle. The problem is that Excel insists that "time" means a time of day. It refuses to let me work…
MathematicalOrchid
  • 61,854
  • 19
  • 123
  • 220
132
votes
26 answers

Last non-empty cell in a column

Does anyone know the formula to find the value of the last non-empty cell in a column, in Microsoft Excel?
Michael S
  • 4,352
  • 5
  • 23
  • 29
132
votes
4 answers

Loop through each row of a range in Excel

This is one of those things that I'm sure there's a built-in function for (and I may well have been told it in the past), but I'm scratching my head to remember it. How do I loop through each row of a multi-column range using Excel VBA? All the…
Margaret
  • 5,749
  • 20
  • 56
  • 72
131
votes
10 answers

Parsing an ISO8601 date/time (including TimeZone) in Excel

I need to parse an ISO8601 date/time format with an included timezone (from an external source) in Excel/VBA, to a normal Excel Date. As far as I can tell, Excel XP (which is what we're using) doesn't have a routine for that built-in, so I guess I'm…
rix0rrr
  • 9,856
  • 5
  • 45
  • 48
131
votes
13 answers

How to create CSV Excel file C#?

I'm looking for a class for creating CSV Excel files. Expected features: Extremely simple to use Escapes commas and quotes so excel handles them fine Exports date and datetimes in timezone-proof format Do you know any class capable of this?
Chris
  • 39,719
  • 45
  • 189
  • 235
130
votes
10 answers

Excel Date to String conversion

In a cell in Excel sheet I have a Date value like: 01/01/2010 14:30:00 I want to convert that Date to Text and also want the Text to look exactly like Date. So a Date value of 01/01/2010 14:30:00 should look like 01/01/2010 14:30:00 but internally…
Chaitanya MSV
  • 6,706
  • 12
  • 40
  • 46
129
votes
23 answers

How to export DataTable to Excel

How can I export a DataTable to Excel in C#? I am using Windows Forms. The DataTable is associated with a DataGridView control. I have to export records of DataTable to Excel.
user1057221
  • 1,363
  • 3
  • 10
  • 7
129
votes
9 answers

How to suppress Update Links warning?

I'm trying to write a script that opens many Excel files. I keep getting the prompt: This workbook contains links to other data sources. I want to keep this message from appearing, so that my script can just automatically go through all the…
sigil
  • 9,370
  • 40
  • 119
  • 199
126
votes
16 answers

Export html table data to Excel using JavaScript / JQuery is not working properly in chrome browser

I have a HTML table in velocity template. I want to export the html table data to excel using either java script or jquery, comatibale with all browser. I am using below script