excel-2010

Sum Excel Distinct Values

橙三吉。 提交于 2019-11-29 12:03:30
I know how to do this with MySQL, but am at a loss as to how (or even if possible) within MS Excel. I am running Excel version 14 on Windows (part of Office Professional 2010). I have a table with two columns...for example one containing phone numbers and the other containing integers (length of phone calls). There are multiple calls from each phone number, so those numbers would likely appear multiple times. I am trying to SUM the total number of minutes per distinct phone number. How can I do this in Excel? ------------------------- | number | duration | ------------------------- | 1234567 |

Substring colouring from Excel VBA: why do some obvious methods not work?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 10:46:57
I've been building some interesting visualizations that rely on VBA code's ability to set different colours for substrings in Excel. For a cell containing a string the syntax works like this rCell.Characters(start,end).Font.Color=SomeColour My application builds the strings and sets the colour values in one step by appending new strings onto the existing values and then setting the colour of the new string. This didn't work. Starting with a complete string and then colouring multiple sub-strings does work. Two simple routines illustrate the difference: Sub TestColourString1() 'designed to show

org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Fail to save

泪湿孤枕 提交于 2019-11-29 10:26:49
I'm facing org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Fail to save:an error occurs while saving the package : The part /docProps/app.xml fail to be saved in the stream with marshaller <br/> org.apache.poi.openxml4j.opc.internal.marshallers.DefaultMarshaller@7c81475b Exception when try to write the each test scenario result(PASS or FAIL) into Excel sheet(.xlsx) after the each test scenario execution completion. I write the following two different modules for this purpose. Please tell me where is the problem and how to resolve it.. //Method for writing results into Report

Excel headers/footers won't change via VBA unless blank

こ雲淡風輕ζ 提交于 2019-11-29 10:04:24
Disclaimer: It's been a few years since I worked (a lot) with VBA, so this might be an issue caused by confusing myself with what is essentially a very different language from what I usually deal with. So; I've got a workbook (Excel 2010) with multiple sheets (20+), most of whom are multi-page. To make things easier when printing everything, I want to add some sheet-specific headers with amongst others the name of the sheet, number of pages and so on. I've written a tiny function that should (in theory) do this for me by iterating over all the sheets setting the header. However, for some

Apache-POI: Unable to write to an existing workbook

一世执手 提交于 2019-11-29 09:43:26
I'm working on a project which needs to read an Excel Workbook, calls the necessary Web Services, and then takes the response from the webservices and enters that information in to the same Excel Workbook that was read. Here is the error I'm seeing when trying to write to the Excel Workbook: Exception in thread "main" org.apache.poi.POIXMLException: java.io.IOException: Can't obtain the input stream from /docProps/app.xml at org.apache.poi.POIXMLDocument.getProperties(POIXMLDocument.java:141) at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:177) at ext.ExcelProcessor.main

Python: Refresh PivotTables in worksheet

别来无恙 提交于 2019-11-29 09:09:00
问题 I'm building a python script that will allow me to open a Excel 2010 worksheet and print it out. I got most of the way import win32com.client office = win32com.client.Dispatch("Excel.Application") wb = office.Workbooks.Open(r"path\to\excel\file\to\print.xlsm") count = wb.Sheets.Count for i in range(count): ws = wb.Worksheets[i] pivotCount = ws.PivotTables().Count for j in range(1, pivotCount+1): #TODO code to refresh each pivot table ws.PrintOut() print "Worksheet: %s - has been sent to the

Closing a Userform with Unload Me doesn't work

旧街凉风 提交于 2019-11-29 09:06:40
I need to close an Excel userform using VBA when a user has clicked a submit button and operations have been carried out. How can I close a Userform from itself? I have tried this but it returns a 361 error. Unload Me As specified by the top answer, I used the following in the code behind the button control. Private Sub btnClose_Click() Unload Me End Sub In doing so, it will not attempt to unload a control, but rather will unload the user form where the button control resides. The "Me" keyword refers to the user form object even when called from a control on the user form. If you are getting

Copying worksheets from multiple workbooks into current workbook

回眸只為那壹抹淺笑 提交于 2019-11-29 05:19:05
Copying worksheets from multiple workbooks into current workbook Hi I was wondering if anybody if you guys could help me out? Im trying to copy multiple workbooks and just save it into only one worksheet. I have 2000 diffrent workbooks with the diffrent amount of rows, The ammount of cells is the same and it dosent change and they are all at the first sheet in every workbook. Im new with this kind of stuff so i'm thankfull for all help u can offer, I cant make it work. I'm using excel 2010 This is what I got atm: Sub LoopThroughDirectory() Dim MyFile As String Dim erow Dim Filepath As String

Return Max Value of range that is determined by an Index & Match lookup

佐手、 提交于 2019-11-29 04:23:31
I need a cell to display the max value of a range who's row is defined by an index and match formula. I know this will be an array function but I'm struggling to get the syntax right. Here is what my data looks like. I have it laid out with Column Letters and Row Numbers like Excel. Using the Table Below as reference, in a second table. When I enter b in cell A1 and y in column B1 , the formula in cell C1 should return the value 35 because 35 is the maximum value in columns C:F on the row determined by A1 and B1 using INDEX and MATCH Table 1. A B C D E F 1 a x 25 6 23 11 2 a y 39 15 42 19 3 b

Lookup using INDEX and MATCH with two criteria

▼魔方 西西 提交于 2019-11-29 02:26:27
I am trying to achieve a basic lookup using INDEX and MATCH. My layout is: Sheet 1 NAME | SITE | DATE Sheet 2 NAME | SITE | DATE I want the 'SITE' column in Sheet 1 to automatically populate with the SITE from Sheet 2 where NAME and DATE match. What I've Tried =INDEX('Sheet2'!B:B,MATCH(A1,'Sheet2'!A:A,0)) This will successfully match NAME, but how can I incorporate an additional MATCH into the formula to match on both NAME and DATE? I suggest the conventional solution to problems of this kind is to concatenate the pair of search terms (ie a helper column) and to add the concatenated pairs to