excel-2010

Optimizing Excel formulas - SUMPRODUCT vs SUMIFS/COUNTIFS

房东的猫 提交于 2019-11-26 17:29:51
问题 According to a couple of web sites, SUMIFS and COUNTIFS are faster than SUMPRODUCT (for example: http://exceluser.com/blog/483/excels-sumifs-or-sumproduct-which-is-faster.html). I have a worksheet with an unknown number of rows (around 200 000) and I'm calculating performance reports with the numbers. I have over 6000 times almost identical SUMPRODUCT formulas with a couple of difference each times (only the conditions change). Here is an example of what I got: =IF(AFO4>0, (SUMPRODUCT((Sheet1

Remove leading or trailing spaces in an entire column of data

别来无恙 提交于 2019-11-26 17:05:51
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. hydrox467 If you would like to use a formula, the TRIM function will do exactly what you're looking for: +----+------------+---------------------+ | | A | B | +----+------------+---------------------+ | 1 | =TRIM(B1) | value to trim here | +----+------------+---------------------+ So to do the whole column... 1) Insert a column 2) Insert TRIM function pointed at cell you are trying to correct. 3) Copy formula down the page

Diagnosing an OLEDB exception when Quering Excel 2010

走远了吗. 提交于 2019-11-26 16:57:31
问题 To query an excel sheet via SQL, I used to use either: Dim excelConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strPath + ";Extended Properties=""Excel 8.0;IMEX=1;HDR=YES;""" or Dim excelConnectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " + strPath + ";Extended Properties=""Excel 12.0;IMEX=1;HDR=YES;""" Now this worked fine until I installed Office 2010. Now I get a Microsoft.Ace.OLEDB.12.0 provider is not registered on this machine

Format excel column to decimal doing export from c#

淺唱寂寞╮ 提交于 2019-11-26 16:49:52
Hi I am exporting database to excel with below method as Response.ClearContent(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment; filename=" + FileName); Response.ContentType = "application/vnd.ms-excel"; EnableViewState = false; Response.Write("<style> TABLE { border:dotted 1px #999; } TH { border:dotted 1px #D5D5D5; text-align:center } TD { border:dotted 1px #D5D5D5; } </style>"); Response.Write("<table>"); Response.Write("<tr>"); Response.Write("<th>Actual Estimated Price</th>"); Response.Write("<th>Aprroved Estimated Price </th>"); Response.Write("<th>Actual

Copy an entire worksheet to a new worksheet in Excel 2010

点点圈 提交于 2019-11-26 16:14:27
问题 I have found similar questions that deal with copying an entire worksheet in one workbook and pasting it to another workbook, but I am interested in simply copying an entire worksheet and pasting it to a new worksheet -- in the same workbook. I'm in the process of converting a 2003 .xls file to 2010 .xlsm and the old method used for copying and pasting between worksheets doesn't paste with the correct row heights. My initial workaround was to loop through each row and grab the row heights

Calling web service using VBA code in Excel 2010

耗尽温柔 提交于 2019-11-26 15:49:15
问题 I am trying to write some VBA code in Excel 2010 that would consume a web service. I am unable to find any related resources on the internet. Can someone please tell me how to do this. 回答1: I don't think the post marked as the answer is right - it links to the Excel 2003 solution, which was based on the MS Office Web Services Toolkit. That solution is no longer valid as the Toolkit is not supported any more. See: MSDN - Consuming Web Services in Excel 2007. The link provides a solution for

Excel CustomTaskPane with WebBrowser control - keyboard/focus issues

和自甴很熟 提交于 2019-11-26 14:48:33
问题 I am having this exact issue https://social.msdn.microsoft.com/Forums/vstudio/en-US/e417e686-032c-4324-b778-fef66c7687cd/excel-customtaskpane-with-webbrowser-control-keyboardfocus-issues?forum=vsto Also mentioned here https://connect.microsoft.com/VisualStudio/feedback/details/521465/the-focus-issue-between-excel-cells-and-excel-customtaskpane-with-webbrowser-control I am writing an Excel 2010 plugin using Visual Studio Professional 2013. I've created a simple CustomTaskPane with a System

How do I use checkboxes in an IF-THEN statement in Excel VBA 2010?

一笑奈何 提交于 2019-11-26 14:29:49
问题 I need to use the value of checkboxes for an IF-THEN statement. Based on what the user checks, the way I have to calculate things changes. However, I can't figure out how to use the checkbox values, or how to detect them. Here is the code I have so far: Private Sub Workbook_Open() Range("E1:F7,A1:A4,B1:B4,C1:C3").Select With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle =

Ignore Duplicates and Create New List of Unique Values in Excel

旧街凉风 提交于 2019-11-26 14:18:20
I have a column of values that often appear as duplicates. I need to create a new column, of unique values based on the first column, as follows: Column A Column B a a a b b c c c This Column B will actually need to appear on a different sheet, within the same workbook, so I assume it will need to work with the sheet2!A1 style format. I have not had any luck with the Data/Filter menu options as this only seems to work on command. I need column B to update automatically whenever a new value is entered into column A. achaudhr Totero's answer is correct. The link is also very helpful. Basically

Excel: Searching for multiple terms in a cell

烂漫一生 提交于 2019-11-26 14:15:33
问题 I use this handy equation to search for a term inside of a cell in excel. =IF(ISNUMBER(SEARCH("*Gingrich*",C1)),"1","") This equation searches for the presence of Gingrich in C1, if it exists, it displays a 1. All I'd like to do is search for more than one term at a time. Anyone know how to add an OR function into this so I can search for Gingrich OR Obama OR Romney etc... ? 回答1: Another way =IF(SUMPRODUCT(--(NOT(ISERR(SEARCH({"Gingrich","Obama","Romney"},C1)))))>0,"1","") Also, if you keep a