excel

excel macro to select multiple row

I have excel macro to select a row to cut and paste to next sheet. Now I want to select multiple row at one time to cut and paste to next sheet, then go back to previous sheet to delete the blank rows that were cut. The code I have for the single row cut and paste is follows: Sub CutPasteRows() Dim iLastRow As Integer 'select the ...

Calling an Excel Add-In method from C# application or vice versa

I have an Excel VBA add-in with a public method in a bas file. This method currently creates a VB6 COM object, which exists in a running VB6 exe/vbp. The VB6 app loads in data and then the Excel add-in method can call methods on the VB6 COM object to load the data into an existing Excel xls. This is all currently working. We have sinc...

Julian Date to mm/dd/yy in excel

I am trying to convert a julian date (yy/ddd) to a regualr mm/dd/yy data in excel vba. I have an idea of using a select case statement that calls a function for each month. But that is alot of code and I am lazy. I am wondering if there is a better way? ...

How to reference logo image multiple times in Excel 2007

Got a company logo need to use on several worksheets. How can I use and reference just one instance of the image to keep file size down, or does it matter? ...

Connecting to Oracle 10g with ODBC from Excel VBA

Hi, The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes Excel. Any ideas?? Thanks Sub GetData() Dim conn As New ADODB.connection Dim connString connString = "DSN=name;Uid=user;P...

import of excel in SQL imports 'NULL' lines

I have a stored procedure that imports differently formatted workbooks into a database table. does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID INTO #test101 FROM OPENROWSET ('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=WorkBook.xls',[WorkSheet$]) Some spreadsheets seem to crea...

How to circumvent the depth limitation of Excel's IF function?

For an Excel formula I need the first cell out of a list of cells which contains a numeric value: A | B | C | ... | Z | ----------------------------- | 0.1 | 0.4 | ... | =0.1 | | 0.2 | ... | =0.2 I use this schema: IF(ISNUMERIC(A1);A1;IF(ISNUMERIC(B1);A2;IF(ISNUMERIC(C1);C1;IF(...)))))))) Unfortunately this only...

Mysql Importing new codes from excel.

I have a CSV file with mappings from project ids to some new category codes. e.g. Project Id, New Code 1, 035 2, 029 3, 023 4, 035 5, 029 .... The above is in a CSV file/excel file I have a table of projects with these project ids and I want to add a new column with the releavan new code. Is there any way I can do that with m...

Excel VBA merge multiple columns into one on separate rows

Hi there! I have an excel 2007 worksheet open with 5 colums and +/-5000 rows of data. What I want to do is create a macro that will: insert 3 blank rows under each record copy the value in that row on column 1 and paste it in the 3 new rows in column 1 CUT the value from column 3 and place it in the first blank row beneath it in colu...

deleting named ranges in VSTO

I have a VSTO spreadsheet, and have re-jigged the front end. I need to change some named ranges to reflect this. Couldn't see a good way of doing this, so I created other named ranges and pointed the code to refer to those instead. Is there a better way? ...

Is there a way to overload the constructor / initialize procedure for a class in VBA?

In C#, I know that I can overload the constructor for a class by specifying it in the body of the class: public class MyClass() { public MyClass(String s) { ... } } This overrides the default constructor (which has no parameters) and forces the class to be initialized with parameter s. I know that in VBA I can initialize my class...

Excel Autofilter in VB.NET

In my application I'm exporting an Excel file by getting the layout of a HTML page. So, in my codebehind, I'm modifying the HTML layout and inserting itens on it like if it was a webpage. Doing it that way, I don't need to use any external library and, as the data I'm exporting is just a table, I don't need nothing complex to handle it. ...

How do I access a class module in Excel VBA from C#?

I have an Excel add-in with a class module. I want to instantiate the class module in C# and call a method on it. How do I do that? ...

Excel Help Needed: insert row with total under each group

i need to insert row with total and a page break under each group e.g. http://i1012.photobucket.com/albums/af250/nsy2204/question.jpg (i cant post images so i posted the link..) i tried the following to insert row... however it inserted rows rather than one rows.... Sub macro() Dim sh1 As Worksheet Dim i As Long, lastrow...

VBA - Calling a function which accepts parent object as variable

Is it possible to create a function which accepts it's parent object as a variable? I suppose the simplest way to illustrate what I'm talking about is to provide an example: Module 1 Code: Function IsProduct() as Boolean IsProduct = (vartype(Parent.Value) <> vbEmpty) End Function ' "Parent" in this case would be a Range ' Module...

hDC for Excel chart

I'd like to be able to draw directly onto a chart in Excel using WinAPI calls. Clearly I need the hDC to do that. Anybody know how to get hold of it? Thx -- DM ...

Which is better open source for Excel file parsing in Java?

Which is better API for excel parsing in Java Apache POI or JExcel API? In terms of speed, memory utilization and code stability. ...

Excel pivot table calculated field total returns unexpected value

I have an Excel spreadsheet which has a pivot table on it. The data itself is quite simple, Number of Units and a Discount (percentage from 0 to 100), pivoted on date across the top and customer down the left hand side. Those numbers are straight from a SQL view, so the pivot table source is just: SELECT * FROM UnitDiscountView All wa...

Excel: removing formulas but keeping the answers as text

I have an Excel document which makes a lot of calculations and shows the results in specific fields as text. I need to get these answers into PHP but Excel Reader can't read those fields, since they are the results of calculations. So, I want to save the Excel document without the formulas/calculations, but with the results as text. Ho...

how to extract characters from a Korean string in VBA

Need to extract the initial character from a Korean word in MS-Excel and MS-Access. When I use Left("한글",1) it will return the first syllable i.e 한, what I need is the initial character i.e ㅎ . Is there a function to do this? or at least an idiom? If you know how to get the Unicode value from the String I'd be able to work it out from...