vba

passing parameters from outlook vba to macro

how to pass some argumemnts to macro in excel called from outllook vba ...

excel 2007 vba Application.Dialogs(xlDialogPrint).Show crashes if user chooses print preview

In Excel 2007, have a button that triggers a macro, which selects a few sheets out of many and sends to Application.Dialogs(xlDialogPrint).Show. As part of selecting the few sheets there are other macros triggered like showing certain rows, password protecting and unprotect-ing, etc. It prints and cancels fine, except when users click ...

Access Data Project Importing CSV File In VBA

Hi Every now and then I come across a problem with an old system one of my colleagues has developed. They tend to have thousands of lines of code to do a simple thing like importing a csv file. Currently the vba process is: open excel application create new worksheet populate the csv file into excel add the header names to the f...

iterate over database query results in vba in excel

Hi. I would like to open a connection to SQL database, and then have access to individual cells. I have an example that uses PivotTableWizard (presented below). I would like to know of a way that does not have anything to do Pivot Tables - I would like to iterate cell-by-cell. Or is this PivotTableWizard suitable for that purpose also? ...

Microsoft Access 2007 Chartspace Help

I have a form with a default view of a chart. This form is loaded as a subform, the data is dynamically filtered by the parent form. It comes up and looks way better than using a chart object (when the form scales the chart object it looks really bad). My question is this. I have been able to find little information on the chartspace o...

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...

ActiveX control tab order in an Excel spreadsheet - is it possible to access/control this from script?

I have embedded a number of ActiveX controls in an Excel 2007 spreadsheet. Is there a way from VBA code to access the tab order assigned to a control so that the controls can be tabbed through in a particular order? The ActiveX controls I have inserted tab through in the insertion order, but this is not correct after changes have been ma...

how to declare an array of user defined type in vb6

Type ABFator a As Single b As Sinlge End Type Dim ABFactorArr(8) As ABFactor 'Basically i want to declare an array of 8 ABFactos which i can then access I do this and the complier gives error user defined type not defined Thanks ...

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...

Hot make a mouse leave event in vb6 over a image

Hi, I have a image for which i have written code in MouseMove to higlight it. this is being done what i want is to when the mouse leaves image the highlights go away but i cant seem to find any event which will do that. i am working in visual basic 6.0. i have tried the mouseup and down event but they dont match my req. Thanks ...

Access 2007 Using the ID value from a list box in VBA/SQL statement

Guys...if I want to run a button click event that takes a list box and uses the ID field that is in the listbox in a SQL statement in VB, then is it me.MyListbox.selected or me.MyListbox.value to get that value? for some reason I have tried both and neither seem to be working. .value returns an empty value, and .selected generates ...

global click event handler (WithEvents)

I am trying to create a class module that will act as a global handler for when ever someone clicks one of the sixty textboxes I have in my form. Th textboxes represent a timecard for the week displaying information as clock in, clock out, lunch start,end,duration, total daily hours under each fo the seven days of the week. When someon...

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...

Tempvars and access 2003

I have a database that is used in a mixed 2003, 2007 environment. I have some minor functionality that uses 2007's new TempVars feature. If it is a 2003 user, it isn't a problem for them to not have those features. How do I write my code so that it will compile and run on Access 2003. I have tried on error resume next but this doesn't w...

How does Excel's FREQUENCY function work?

With the following function: =FREQUENCY(C2:C724,D2:D37) The second parameter is the BIN What I don't understand is why Excel would increment the BIN for the rest of your values. The BIN does not change! It stays the same bin. Yet when I paste the formula for all my values it does this: =FREQUENCY(C2:C724,D2:D37) =FREQUENCY(C2:C724,D...

Pass multidimensional array into Excel UDF in VBA

How do I pass multidimensional arrays or nested arrays into an Excel UDF which allow me to reference other ranges? I have a UDF defined as "ARY" which does what Array() does in VBA but in a worksheet function. This allows me to have a worksheet formula like =TEST1(ARY(ARY("A", "B"), "C")) or =TEST1(ARY(ARY(A1, B1), C1) However, I get...

Search for text in name range in Sheet 1and return Value in Sheet 2 using Excel VBA

Hi, I have something of the following : Sheet 1 (Name Range : Code) Column A -------- Column B School ------------ 1 College ----------- 2 University--------- 3 Sheet 2 Cell A1 = (Search for "College" in Name Range Code and get the Value of "2" as code. ) So value of 2 should be present in Cell A1. Please provide excel VBA ...

Customize the Cursor flow / direction on pressing enter in Excel worksheet / table grid using Excel VBA

I have a column as follows : Column A---------------Column B 100 ----------------- 500 200 ----------------- 600 AA ----------------- ABCD BB ----------------- DEFG CC ----------------- FF DD ----------------- GG EE -----------------II 300 ----------------- 700 400 ----------------- 800 I want the Cursor to be present at cell location...

Accessing Item.To in outlook VBA

In a macro I need to access the names in Item.To while typing an email. For example while typing the email goto the tools menu and run the macro from the 'macro' submenu. When the code trys to use Item.To there is a debug exception and the debug tool tells me "Object required". I can access Item.To durring Application_ItemSend, so I ...

how to persist some values in outlook vba

As part of what i am doing i need to access varaiables even after the session with the outllok is closed is there any way to persist value ...