excel-vba

Merge the contents of 2 cells into another 3rd cell using VBA in Excel

Hi everybody, I have two cells lets say: A1 and A2 The content of each one of them is a string: A1: Hallo A2: World My goal is to merge the contents of A1 and A2 in another cell e.g. A3 i.e. A3's content should be: Hallo World I would like to do this using a VBA macro and not only for strings as contents.. Thanks both of u for y...

Problem with dynamically parsing the VBA File

I have an MS Office 2003 excel file with macro. I have to parse the VBA code in macro using c#. While parsing i have to identify whether the keyword is a method name or property. And also is there a component from Microsoft to access all the VBA functions dynamically using reflection in c#? Is there a way to do this? If so please sugg...

Writing a Macro to Use the Transpose Fuction Repeatedly

I am trying move rows of values into a column in Excel. The transpose function work well, but will only move one row at a time. I would like to get a macro that will covert 173 rows of data across three columns into one column. Please see example below. Thanks in advance for any help. Rows 98,058 98,058 98,314 82,362 82,684 83,326 ...

What is Excel 2007 workbook Name size limit? Why?

Workbook names in Excel 2007 are supposed to be limited in size only by memory, but this appears not to be the case. Eventually, an array saved to a name will get big enough that when you try to save you get (paraphrased): "one or more of the formulas in this workbook is larger than the 8192 character limit, please save as binary file"....

Excel formula to determine cell ID when a series of numbers turns negative

Sample data A B 1 Date Amount 2 Apr 1 $6,000 3 May 1 $4,250 4 June 1 $2,750 5 July 1 $1,000 6 Aug 1 -$0.075 <- This Cell/Row 7 Sept 1 -$0.2500 In a column of numbers (in reality 100-200 rows), when the value changes to negative, e.g. if these we're amounts owed on a l...

Showing caption for CommandBar button with Excel VBA

I'm trying to add a button to a new CommandBar (for the Add-in tab) with Excel VBA. I can get the button into the ribbon and can get an image to show up for it if I use a FaceId, but I can't get the Caption to appear. Is there some way to do this? Do i have to use an image instead? With Application.CommandBars.Add("Open Forms") Wi...

excel macro to change unformatted text data to correctly-typed data

I'm populating an excel sheet from DTS, but the resulting output is formatted as text since DTS sees the cells as varchar(255). I'm planning on adding a macro that will format the values correctly as numeric or datetime. What VBA would I use for this? eg the value in a cell shows as "2009-01-01 00:00:00". If I press F2 to edit the cell,...

How to add headers to a multicolumn listbox in an Excel userform using VBA

Is it possible to set up the headers in a multicolumn listbox without using a worksheet range as the source. The following uses an array of variants which is assigned to the list property of the listbox, the headers appear blank. Sub testMultiColumnLb() ReDim arr(1 To 3, 1 To 2) arr(1, 1) = "1" arr(1, 2) = "One" arr(2,...

How to obtain the macros defined in an Excel workbook

Is there any way, in either VBA or C# code, to get a list of the existing macros defined in a workbook? Ideally, this list would have a method definition signatures, but just getting a list of the available macros would be great. Is this possible? ...

Excel Macro send email

Hello there, i have a report that i would like to send via excel. it will include the recipitents, subject and the information in the body. actually it could copy the cells in question. what i did so far is create a button and assign a macro to it with this code: Private Sub CommandButton1_Click() Application.Dialogs(xlDialogSendMail)....

Macro to save active Sheet as new workbook, ask user for location and remove macros from the new workbook

Hi everybody, I have a Workbook with three WorkSheets: Product , Customer, Journal. What I need is a macro assigned to a button within each one of the above Sheets. If the button is clicked by the user, then the active sheet should be saved as a new workbook with the following naming convention: SheetName_ContentofCellB3_DD.MM.YYYY wh...

Splitting Excel File Using VB

I have an excel worksheet that produces data into another worksheet. After this I export from the worksheet into a csv format. I need to be able to split the data every 250 rows into a new file regardless of the information contained. I'm using VB for the coding in this. Any help greatly appreciated. Thanks ...

CopyOrigin on Insert in Excel VBA

Can anyone tell me what the CopyOrigin parameter of Insert is used for? And what values it will accept? I have included the vba help (which wasn't really that helpful): Inserts a cell or a range of cells into the worksheet or macro sheet and shifts other cells away to make space. expression.Insert(Shift, CopyOrigin) expre...

Excel VBA Macro

The List:- “Problem Sheet”(worksheet). I have an excel sheet which represents a list of problem issues (Rows) which varies in size every day (eg more or fewer rows); Each row has been assigned a name; The assigned name is always in the same column “M” of the “Problem Sheet”; An individual assignment name does not necessarily appear eve...

Sending formatted Lotus Notes rich text email from Excel VBA

...

How to "flatten" or "collapse" a 2D Excel table into 1D?

I have a two dimensional table with countries and years in Excel. eg. 1961 1962 1963 1964 USA a x g y France u e h a Germany o x n p I'd like to "flatten" it, such that I have Country in the first col, Yea...

EXCEL Formula or VBA To Extract Data Based on Another Cell's Data

I have the following worksheet #1 (simplified for the question) of person and age: Person Age Bob 40 Brett 35 Brian 38 I would like to setup another worksheet where I have the following: Person Age Spot #1 FORMULA The user will enter a name in Spot #1 and I want a formula/code in the cell titled FORMULA where t...

Where are all the places that VBA macros for Excel 2007 can be turned off?

Macros refuse to run for me in Excel 2007 on Windows Server 2003. The macro and visual basic icons on the ribbon are grayed out. If I open a workbook with a macro, I get the warning: " This workbook has lost its VBA project, ActiveX controls and any other programmability-related features." If I try to make a new excel template in VSTO (E...

Format function vba changing date

The format function in vba is changing the date. e.g for format("3/12/2009","DD/MM/YYYY"), the function returns 12/03/2009 where "3/12/2009" is what excel vba reads from a cell that has the value 12-Mar-2009 and the format as "dd-mmm-yyyy" ...

How to call a method inde an Xlam from C++ Unmanaged XLL file

I have an Xlam addin with some methods, I'd like to call these methods from a C++ Unmanaged Xll file, is there a way to do this? ...