excel-2010

Identify a child cell in an array

廉价感情. 提交于 2019-12-04 11:48:54
In the following array of 24 rows, there are 9 children (terminal nodes) - shaded yellow for clarity. In other words, every entry has a child except for the terminal nodes. For example, 5E has 2 two terminal nodes. 14G is a terminal node, but 15G is not. 16H is terminal. 17H has 2 children (terminal nodes). 22F also has 2 children (terminal nodes). How to write an excel function or macro that identifies these terminal nodes? Given your data, the following conditional format seems to work. Select A1:I24, then use this CF formula: =AND(A1<>"",OFFSET(A1,1,1)="") Format with a yellow fill. EDIT:

Open XML SDK 2.0 to get access to excel 2010 worksheet by name

浪尽此生 提交于 2019-12-04 10:11:39
问题 I have an Excel 2010 spreadsheet that has 3 worksheets named Sheet1, Sheet2 and Sheet3. I'm trying to get a reference to a worksheet by name. I'm using the code: using (SpreadsheetDocument myWorkbook = SpreadsheetDocument.Open(FileName, true)) { //Access the main Workbook part, which contains all references WorkbookPart workbookPart = myWorkbook.WorkbookPart; WorksheetPart worksheetPart = workbookPart.WorksheetParts.Last(); // this gives me Sheet1 SheetData sheetData = worksheetPart.Worksheet

Creating Parameterized SQL Queries in Excel 2010 with VBA

非 Y 不嫁゛ 提交于 2019-12-04 10:00:06
I came across the following link: http://www.informit.com/guides/content.aspx?g=sqlserver&seqNum=135 In it, they list relatively simple code to query the SQL Database from Excel VBA. ' Declare the QueryTable object Dim qt As QueryTable ' Set up the SQL Statement sqlstring = "select au_fname, au_lname from authors" ' Set up the connection string, reference an ODBC connection ' There are several ways to do this ' Leave the name and password blank for NT authentication connstring = _ "ODBC;DSN=pubs;UID=;PWD=;Database=pubs" ' Now implement the connection, run the query, and add ' the results to

Error -2147417848 Automation error The object invoked has disconnected from its clients

天涯浪子 提交于 2019-12-04 09:44:41
I am working on clearing some tables in 3 excel sheets. My code was working fine with Excel 2007, as i switched to excel 2010 i started getting this runtime error Automation error The object invoked has disconnected from its clients , error number -2147417848 and then excel freezes. the error is showing after running this function 2 times on the line Sheets("Risk Details").Range("A3" & ":BV" & (count + 1)).Delete Shift:=xlUp can anyone help me in finding out why this is happening and how to work around it? below are the full code for the function Function clearData(Optional refresh As Boolean)

remove duplicate value but keep rest of the row values

混江龙づ霸主 提交于 2019-12-04 09:03:23
I have a excel sheet(csv) like this one: and I want the output(tab delimited) to be like this: Basically: replace duplicates with blanks but if col6 value is different from the previous row for the same col1 value, all the data fields should be included. I am struggling to create a formula which would do this. If I try to "Remove Duplicates" it removes the value and shifts the values up one row. I want it to remove the duplicates but not shift the values up. Try this (note, you need a blank top row (edit: Actually, you're fine you have a header row)): =IF(A2<>A1,A2,IF(D2<>D1,A2,"")) =IF(A2<>A1

Re-enable VSTO add-in that is disabled by the Application due to multiple errors

半世苍凉 提交于 2019-12-04 08:59:05
I am writing and debugging an Excel VSTO Ribbon addin and it sometimes crashes due to errors in code. When Excel finally decides it's too much and asked me whether I want to permanantly disable it, I ACCIDENTALLY clicked yes. Now no matter what I do, I cannot get the addin to automatically load on Excel startup. I go to COMs AddIn dialog and set the checkbox; deleted the registry settings manually; cleaned the project in Visual Studio and rebuilt it -- no use. Where should I configure to make it auto load my VSTO again? Thanks in advance. btw, it's Excel 2010 on my dev machine. You have made

Freezing Row 1 and Column A at the same time [closed]

情到浓时终转凉″ 提交于 2019-12-04 07:35:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I want to "freeze" Row 1 and Column A simultaneously in Excel 2010. Is this possible? 回答1: Select cell B2 and click "Freeze Panes" this will freeze Row 1 and Column A. For future reference, selecting Freeze Panes in Excel will freeze the rows above your selected cell and the columns to the left of your selected

EXCEL Reference a cell in the previous visible row

一笑奈何 提交于 2019-12-04 07:34:03
How can I reference a cell in the same column in the previous visible row from a filtered range? This is very easy if we prepare to do it. Say we have data like: The first step is to introduce a "helper" column. In E2 we enter: =IF(SUBTOTAL(3,A2:A2)=0,MIN($E$1:E1)-1,SUBTOTAL(3,$A$2:$A2)) and copy down: Now the cool thing about the "helper" column is that no matter how you filter it, it always shows a simple sequential sequence....let's filter for Alice This means that any cell can: retrieve the value in column E subtract 1 from it use this value in a Index()/Match() formula to retrieve any

Protect Excel Worksheet For Read Only But Enable External Data Refresh

别来无恙 提交于 2019-12-04 07:19:19
I have an Excel 2010 workbook. One worksheet imports data from an external data connection (SQL query). I have also added additional columns to the worksheet to perform calculations on the data and to massage it a bit. The worksheet forms the backbone of the raw data used in the other worksheets. I'd like to protect the worksheet to make it read-only (allowing sort, filter, pivot table usage). I know how to do this with the protect worksheet feature. But when the worksheet is protected, I can't use the Refresh button to refresh the data from the source and I want users to be able to do this. I

Workbooks.Open returns different file than Filename

久未见 提交于 2019-12-04 07:03:44
I am having the strangest problem. I was writing the below code on my laptop the other day and it worked fine. Now, I am testing it on my desktop and it's stopped working. First, here's my code Dim oApp As Application Dim oWb As Workbook Set oApp = New Application oApp.Visible = True Set oWb = oApp.Workbooks.Open(Filename:="C:\myFile.xlsx", ReadOnly:=True) debug.print oWb.name 'returns "SOLVER.XLAM" ' "SOLVER.XLAM" is not "myFile.xlsx' debug.print oApp.Workbooks.Count 'returns 1 debug.print oApp.Workbooks(1).name 'returns "myFile.xlsx" Now, I know that solver is an add in, and it gets loaded