excel

Excel Macro: how do I expand a ROW height to accomodate wrap text?

I'm slowly amending and expanding an If...ElseIf...Else statement (see post) to help me format a long list of categories and sub-categories (thanks marg & Lunatik). I've assigned fixed row heights to 90% of the range/lines. Now I'm stuck on those cells with lots of text that wraps over two lines in a cell. Two lines of text does not fit...

How to convert excel file into mysql database??

Hi guys my boss wants me to create a mysql database for an existing excel file. I was wondering if there are any ways to do convert or import excel file? I have searched google but didn't find anything useful. I appreciate for any reply....Thanks. ...

Excel VBA: Answer gets "stuck"

I'm new to VBA in Excel 2003. I've written a UDF that takes in two strings: one filter and one that will be a cell reference. When I am debugging and call the function a couple times in a row in the VBA editor, everything works as I expect. But when I use the UDF multiple times in a spreadsheet, all uses show the exact same answer, de...

Export Excel from web, what's the BEST way?

About 3 years ago, I was looking for a way to allow a web app user to download table results to an Excel file. I knew that I didn't want to put Office on the web server and that I probably wanted to create the XLS file in XML format. The question was: what was the best way? Now I am writing my resume and I am trying to recap the things ...

Read an excel uploaded through FileUpload

I have an ASP.NET web application that has a fileupload control to allow users to upload an excel file for it to read. I'm using an OleDBConnection and I feel like my connection string or querystring is wrong since the app keeps throwing OleDBExceptions at me (ouch!). What would be a good way to save or access the uploaded files? Here...

Creating Excel dashboards from info stored on SQL

Hi all, I'm creating an Excel dashboard that imports a variable number months' worth of financial/accounting information from a database to an Excel sheet. Using this information I have a Calculations sheet that computes some financial indicators, again, month by month. Finally, this information is displayed in graphs on a separate she...

Complicated Excel VBA Macro with Loop

Hi all. I require help with a reasonably complicated VBA macro loop for a dataset I've been provided. The dataset exists as one long column one thousands of different entries. I've tried recording macros but I am at a loss at the best way to approach it. Any help would be greatly appreciated. In its simplest terms, I need to locate a ...

How to write VBA code to hide all the column and row headings in Excel?

Private Sub hideHeadings() Dim obj As Window For Each obj In Application.Windows obj.DisplayHeadings = False Next obj End Sub The above is my attempt, as when I recorded code to do it it goes ActiveWindow.DisplayHeadings = false. But I must be missing something. Please help thanks in advance. ...

Get in column B the words of column A that are `not in dictionary`

How could I create a macro that would check each cell of column A, find the words that are not in the defined dictionary, and write them (separated by space) in the next cell. In the picture below you can see an example of the worksheet after that macro was completed. The complete idea was to get a (varchar) column from a database and...

Excel 2002 Change R1C1 to A1B1

Dear Friends, Im using Excel 2002. Something happened to my excel. The A1B1 is showing as R1C1 system. I want to change that back to A1B1. How do I change that? Thanks in Advance. Nitin ...

Set currency format for excel cell that created with ExcelPackage

How can I set currency format for excel cell that created with ExcelPackage? worksheet.Cell(i, 7).Value = item.Price.ToString(); ...

How to find out if an entire row is blank in excel thorough vba

I have a sheet in which I have data from two different sources.I've a blank row between them.I want to make this blank row as my delimiter.How can I find out if the entire row is blank or not. ...

Closing Excel Application using VBA

I have used the following without success. The active workbook closes, indeed, but the excel window remains open. Application.ActiveWindow.Close SaveChanges:=False ActiveWorkbook.Close SaveChanges:=False Which is the command that terminates the application? EDIT To say a little more: In the workbook Open event I run a macro. I want ...

Insert carriage returns in Excel via OleDb c#

I am inserting text into a Memo field in a Excel cell via a insert statement using OleDb command object. When I try to insert a carriage return, char 10, what is displayed is a black square (MS Sans Serif). When I look at the top edit cell (don't know the offical name) the text is formatted correctly with carriage returns. I am trying...

Unlocking range of cells in excel selected by cellname Office 2007

I have 3 cells which are merged with each other and are referenced to with a given cellname (for example "foo"). I now want to unlock these cells with the locked attribute. The lock in the following code will not work, but the value will be successfully assigned to the cell: Workbooks(loadedSheetName).Worksheets("foo").Range("bar").Lo...

How do I use Perl and Excel OLE to copy a worksheet to a new or existing workbook?

I have tried using the following Perl code, but the worksheet does not copy (nor move) and no error message is returned. Thanks in advance for your ideas. #!/usr/bin/perl -w use strict; use warnings; use OLE; use Win32::OLE::Const 'Microsoft Excel'; my $Excel = CreateObject OLE "Excel.Application"; my $Book2 = $Excel->Workbooks->Add()...

How to do excel interop on windows 2008?

Recently deployed my web app on Windows Server2008, IIS7 (with Office installed). After chasing (& catching) various other errors, I'm facing one I'm not sure even where to begin. On Cassini (visual studio dev server) everything worked flawlessly (reading excel through excel interop). On w2008 IIS it throws vague error: Value cann...

How do you get a Range to return its Name?

Dim sampleRange as Range Set sampleRange = Worksheet.Range(Cells(1,1),Cells(1,4) sampleRange.Name = "Range1" MsgBox sampleRange.Nname This will show the actual address of the range, not the name. Why? How do I get a named range to return its name? ...

Using an Array of Ranges in VBA - Excel

Does VBA support using an array of range variables? dim rangeArray() as range dim count as integer dim i as integer count = 3 redim rangeArray(1 to count) for i = 1 to count msgbox rangeArray(i).cells(1,1).value next I can't get it to work in this type of application. I want to store a series of ranges in a certain order as a "ma...

excel ttest array with condition

Hi, i don't want vb code answer for this one. I was just wondering how to do this, for example in MS Excel there is a TTEST function which takes in array1, array2, tails, and type. My question is for array1 for example I want to put A1:A3, but I don't want some of the values and do not want them counted as a total number of available va...