excel-vba

vba excel, get start range and end range of a vertically merged cell

Hi.. actually my question is just like the title says.. i need to find out the first cell and the last cell of a vertically merged cell.. lets say i merge the Cells B2 down to B50 how can i get in VBA the start cell(=B2) and the end cell(=B50) ? thanks a lot ...

Excel2k7/VBA:getting the cell address when a form button is clicked in it

Hello All, I've multiple form buttons in multiple cells and when clicked any one of them, i've to perform a function. Now i need to know which cell has this clicked button so that i can take next steps. Thanks in advance ...

Excel VBA - Sum up a column

Hi, I'm trying to sum up a column in Excel VBA , however because there are blank spaces, I'm getting 0 as the sum. Dim rExternalTotal As Range , dExternalTotal as Double Set rExternalTotal = Range(rReportData.Offset(0, 0), rReportData.Offset(261, 0).End(xlUp)) dExternalTotal = Application.WorksheetFunction.Sum(rExternalTotal) dExterna...

Trim Cells using VBA in Excel

I have what seems like a simple problem with some data in Excel. I have a lot of data with leading spaces pasted from a web table, and I would like to get rid of the initial space. I cribbed the following code (I am completely new to VBA), but it doesn't seem to work. When I step through it in the debugger it looks like an infinite loop....

Can VBA Reach Across Instances of Excel?

Can an Excel VBA macro, running in one instance of Excel, access the workbooks of another running instance of Excel? For example, I would like to create a list of all workbooks that are open in any running instance of Excel. ...

Excel macro send rich mail using LotusNotes

Hi everybody. I'm working on a small macro to send mail from excel 2007 using my Lotus Notes session. The sending mail part is working fine. Now I need to send in the body part, a part of a stylesheet (for instance the area from A1:B20). This area has colors, bold font. To send my email here is the code: Set oSess = CreateObject("Notes...

Fine Last Used Cell Address in the Row

i am populating the row from The Database using VBA I had More than 50 Column in the Excel sheet in that i wants to find last column address to display the total of the entire data's total is there is any possible please guide me thanks in advance ...

How to change the title bar text of a Userform in VBA?

I'm maintaining an old-ish application written in VBA for Excel 2002 (XP)/2003, and am trying to internationalise it. To do this, I read in the translated strings dynamically and update the various controls on my userform by updating their .Caption property. This works as expected for all controls but not for the form itself -- when I ...

EXCEL VBA help - function to insert blank cell

Hi, I need some help with an excel VBA function. I have data that looks like this ColA ColB a123 a123 a124 a124 a127 a126 a128 a127 .... .... I want to compare the contents of ColA and ColB, Where the contents are different I want to insert a blank cell into column A. So the result wi...

When Creating Macro, What Setting Do I Need?

I have a bunch of VBA code that I'd like to throw in a macro. Basically I call a bunch of subs that update the page. It looks something like this: Call Update1("Work", strConn) Call Update2("Work", strConn) Call Update3("Work", strConn) where Update1, Update2, and update3 are all in the same sheet with the form Public Sub Update1(s...

Worksheets(ws.Name).Range("A" & i & ":G" & i).Copy _ Destination:=Worksheets("Sheet1").Range("A" & emptyCell)

I have this Excel VB code, and everytime after it executes this line, it pauses for half a second: Worksheets(ws.Name).Range("A" & i & ":G" & i).Copy _ Destination:=Worksheets("Sheet1").Range("A" & emptyCell) Can someone tell me what it is doing, and how I can prevent it from taking so long? I have Microsoft Excel 2007 on Windows XP ...

Creating a border around cells with the same value.

I have a table like the one below. How can I get Excel to put borders around groups with the same number in the 4th column so that there is a border around the groups. I was thinking conditional formatting could do it but I can't think how. So I think the only option is a macro. Could anybody help? 1 64436 549419 1 2 64437 549420 1 ...

How to Lookup For something main VBA

Hi, I wanna know how to Lookup For many number in a column A corresponding to a name in Column B By coding in VBA..And Write it in column C??? Thanks in advance..Im new in this... Exemple A B C 200-333 Jack 200-345 Lea 200-346 Fresh 200-347 Tide ...

Excel - Combine multiple columns into one column

Hey everyone. I'm new to excel and VBA and I'm stuck at this problem. I have multiple lists that are in separate columns in excel. What I need to do is combine these columns of data into one big column. I do not care if there are duplicate entries, however I want it to skip row 1 of each column. ROW1| 1 2 3 ROW2| A D G ROW3|...

Push or Pull to Excel for reporting data

I am unsure which is the best way to go here. I have a third party Excel 2003 spreadsheet that needs to be filled in on a monthly basis and emailed. Currently it is a manual process and I am in the process of automating the generation of the spreadsheet. I have been throwing around different ideas of how to get the data into the spre...

Grabbing "last saved by" metadata from access '03 file to excel '03 in VBA

So I am in Excel trying to read the last saved metadata from an Access database, but I cannot figure out how on earth to do this. If I use environ$("username") it will give my the last saved information for the excel document where I am coding, not the access db that I want it to grab from. Excel has a built in function for grabbing us...

Excel vba -get ActiveX Control checkbox when event handler is triggered

I have an excel spreadsheet that is separated into different sections with named ranges. I want to hide a named range when a checkbox is clicked. I can do this for one checkbox, but I would like to have a single function that can hide the appropriate section based on the calling checkbox. I was planning on calling that function from t...

[change] Vlookup onto another workbook

Hello, here is my dilemma. I have two worksheets one that has the name of clients and one that i want to copy the names to depending on the city. For instance: associated to each column is last name, first name and city. i have hundreds of names associated to different cities and what i would like is from worksheet1.xls to copy all the...

Using a c# .net object in an Excel VBA form

Hi I have a .net object that I want to use in Excel. I have an existing VBA script that i need to alter to call this the object from. I have then converted the object to a TLB. I've not really touched on this area before so any help will be appreciated. I have created an interface [Guid("0F700B48-E0CA-446b-B87E-555BCC317D74"),Interfa...

How to get the numbers matching with the name in vba code

Sorry about that. Basecly I want all the numbers in Col A That match with the names in Col B. I want to fill Col C with those numbers by order. Thank you ...