excel-vba

I need help to merge 2 macros

Hello, I need help to merge 2 macros. Bascially, after "MACRO1" finishes running in File 1 ( macro 1 itself located in file 1), i want excel to run " MACRO 2" in File 2 (macro 2 itself located in file 2) . I tried using the following code: Windows("2.xls").Activate Application.Run "2.xls!Macro2" However, Instead of running in file 2...

Connection string syntax for Classic ADO / ODBC / Oracle 10g EZConnect

I'm trying to connect various VBA projects to an Oracle 10g back end using ADO (2.8) and no TNS. After various attempts, we've decided that the simplest series of steps for a clean installation include: Set up an Oracle Instant Client Install the accompanying ODBC driver (Test the connection using EZCONNECT via SQL Plus) (Test the conn...

VBA macro in a single active worksheet only

Can anyone help me with running a macro on a single sheet. The macro connects to a database and updates cells with data. i've used the application.on_time method to run the macro at a time interfval of 15 minutes The data update is perfectly fine. The problem that i face is that the macro is updating all open worksheets with the data...

Filling cells based on values in range

I need help writing a sub routine for my program in excel. What I am trying to do is take information from one sheet (Bar code master) and fill it in to another sheet(Template). I recorded a macro and that got me to the point of copying and pasting info. On the bar code master sheet I have the range of bar codes listed with the beginning...

VLOOKUP according to LOCATION but not the absolute name....EXCEL VBA help please!

Hello, i put the name of the files i want to perform in some cells and wrote a maco for excel to call up the file according to the location. (lets say I write 1.xls in cells Cells(2, "B")) e.g. A = Cells(1, "B") B = Cells(2, "B") C = Cells(3, "B") Workbooks.Open Filename:=A Windows(A).Activate Now, i want to do VLOOKUP by lookin...

MSQuery query changed in Excel

I have a query that runs in an Excel Macro that has been changed and I can't figure out how to change the code in the macro. The original query is: With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _ "ODBC;DSN=MS Access Database;DBQ=" & strpath & ";DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout" _ ), A...

Error when calling VBA function from VSTO code

I have the following VBA code in a module of one of my .xlt files: Public Sub SetShapeTop(ByVal shapeName As String, ByVal topValue As Single) ThisWorkbook.ActiveSheet.Shapes(shapeName).Top = topValue End Sub In my VSTO add-in, I have the following C# code which tries to call that VBA function: m_worksheet.Application.Run("SetShape...

Excel / VBA Remove duplicate rows by cross referencing 2 different sheets then deleting 1 row

I have 2 separate sheets, lets call them sheet A, sheet B. I have data in sheet B which is also in sheet A. I want to find those rows that are equal and remove them from sheet B. I cannot combine the 2 sheets and use filters because I'm doing dynamic SQL to query different data. Each sheet has a unique key column I'm ok with VBA sugg...

VLOOKUP according to location not NAME

Hello, i put the name of the files i want to perform in some cells and wrote a maco for excel to call up the file according to the location. (lets say I write 1.xls in cells Cells(2, "B")) e.g. A = Cells(1, "B") B = Cells(2, "B") C = Cells(3, "B") Workbooks.Open Filename:=A Windows(A).Activate Now, i want to do VLOOKUP by looki...

why can't I see voting buttons in a bloomberg email?

Hello, I'm sending an email from Outlook 2003 (soon to be 2007) to a colleague's Bloomberg email address. I added voting buttons to it. Outlook users can all see the buttons, but the colleague who's reading the email in his Bloomberg console cannot. Is there any way I can get those voting buttons to be displayed to him? If not, are ...

EXcel VBA : Excel Macro to create table in a PowerPoint

Hi friends, My requirement is I have a Excel which contains some data. I would like to select some data from the excel and open a PowerPoint file and Create Table in PowerPoint and populate the data in to it Right now I have succeeded in collecting the data from excel opening a PowerPoint file through Excel VBA Code. Code for Openin...

Excel imports SQL Data, but changes the order of 1 column once imported..

I do an import data from a query I created in MS Query. Lets say the columns are in order A,B,C,D,E,F in the Query Editor. Once the I save the query, return data to Excel, the imported data has a new column order A,B,C,F,D,E -- note the F column was moved where D was. Any ideas on how to solve this issue? Thanks guys. Assume variabl...

Enter userform data in new worksheet

I am tring to save textbox value in the new worksheet each time I click on command button and name the sheets as day1, day2,day3 so on .I tried different way , i dont know if it is possible or not .i will appreciate if someone piont me to right direction . ...

Ignore excel vba errors during read cell values from C# through COM interop.

I need to read cell values from Excel document. Some documents contain vba scripts and formulas that can contain error. So during reading document occur such errors and excel show UI dialogs with question and error information. Without any reactions on these dialogs reading cannot continue. How I can ignore these errors or close dialogs...

how to insert new row like Excel functions in MS ACCESS

hi there, I need to find a way to make grid in MS Access & insert new lines to it by code VBA only exactly how excel behave. ...

excel vb loop/concatenate - what am Idoing wrong

I wanted to make all my btn invisible. They are named: btnHere1 btnHere2 btnHere3 btnHere4 For i = 1 To 4 ["btnHere" & i].Visible = False Next ...

Getting excel activex calendar control working on all machines

Hi, I have an excel spreadsheet which contains a calendar control (Microsoft Calendar Control 2007, MSCAL.ocx) and activex comboBox controls. All works fine on my own PC but when i try it on another one (with the same version of excel i.e. 2007) it seems to lose the reference to the Microsoft Calendar Control 2007. I get an error messa...

VBProject Tools-->VBA Project Propeties password protected

Is there any way i can change the project property? When i go to VB screen in an excel sheet , i see that the Tools-->VBA Project Properties is password protected. ...

VBA - problem with recognized variable in event handler

VBA - problem with recognized variable in event handler. in the event handler (click) i can't get the program to recognize variable j (it's local). when it get to the line: check.Value = MyCheck & j.Value it return : 'Mycheck1' only, even though its in a loop. i need the program to go throw all of the check buttons and check if they are...

Excel macro Auto start only in XLT file and not in XLS file.

I am using and XLT that contains macros, it creates an XLS by open, and save it in a choosen directory, the problem is, the saved file contains the same macros as the XLT. Is there any chance to modify the proc to make it save the generated file without the macros? best regards, Thomas ...