vba

Setup an Excel template so calculations are not dependant on a specific number of columns / rows

Problem Statement: I'm creating a template for multi tiered complicated calculations in MS Excel that depend on a few input "n x 3" matrices. It is really difficult to redesign the 15 sheets or so (200 ~ 300 lines each) every time I have a different "n" where "n" ranges from 3 to 900. Goals: I'd like to input the number of "n" in ...

Can I rewrite a Javascript function using Excel VBA?

Hi, Don't know how to do this at all, but if the onclick of a button is similar to below: onclick="ConfirmAvailable();" function ConfirmAvailable() { if (document.getElementById("AvailableCB").checked) { return YesNoDialog("'Are you sure?'"); } else { return true; } } Is it possible, if I set ConfirmAvailable()="" using Exce...

Office 2007 VBA

Amongst the swamp of documentation that is MSDN there is not an article to be found about the latest and greatest tools to be used in conjunction with Office 2007, specifically in the "VBA" department. We've been using old school versions of Office for many years and had to use VBA. Upgrading to Office 2007 was a prospect for the PDF t...

Compare rows in a spreadsheet with records in a database

I have an Excel spreadsheet provided as a report, when really its more of a database, with the row number acting as primary key. I need to compare some columns in this set with a different set of records from an Access 2007 database. To make matters more complicated, this needs to be done automatically, without user input, on a regular...

Access 2003 VBA: custom form property problem

I have a regular form called "Fish". It has a TreeCtl called "loctree" which I used as a location chooser to change a field in Fish. I've since added several subforms to Fish. Two of these have location fields that I would like to use loctree for. Since I didn't want to instantiate a new TreeCtl for each of these subforms, I thought I ...

Is there a way to get full IntelliSense for VBA in Access and Excel 2007?

In VB.NET, the IntelliSense pops up as soon as you start typing which gives you a pretty full list of things you can use at that moment. The IntelliSense in VBA however, doesn't kick on for me until a period is put after the part you're using. For example, I go into the VBA editor in Excel 2007 and start typing the word "Range" but the I...

Access VBA subform event wont fire when parent form clicked

OK, I have several controls on a parent form, along with a subform. The user enters data in the subform. Then when they click off the subform, I have code to validate their data. However, MS in its infinite wisdom, has chosen to not let the focus leave the subform until the user clicks another control on the parent form (instead of the p...

Macro to copy select rows to another worksheet and sort by month

Does anyone have a macro that will take data from a compiled list, sort out a particular month, the paste only the sorted month into a new worksheet? What I am setting up is a log where the samples are placed in the "Full List" by all employees and then when the boss wants to view only a certain months samples say January, he will be ...

Word vba - Press tab to go to bookmark?

Hi, I'm trying to create a macro which allows me to press the Tab-button to go to a predefined bookmark. I know this can probably be done using Words built in functions, but there are some bugs that I need to work around. So I was thinking of creating some [Type text in here]-fields and encapsulate these in bookmarks. Then, by pressing...

Hidden features of VBA

Which features of the VBA language are either poorly documented, or simply not often used? ...

MS Access 03 - How do I call a VB Function into a Sub Procedure

I know this is a simple question for someone out there, but I have never really used function module at all because I did not understand what they were. So I have a whole bunch of things I can use this for (cut down on redundancy), but I want to know how I call call into into a sub (like a button click) procedure from a form. I tried t...

Elegant way to highlight chart data series in Excel

I want to outline the chart data range source(s) in a table, in much the same way that the GUI will outline a range in blue if the chart data series is clicked. The user can choose various chart views and the range highlight colours for each data series need to match those displayed in the chart. For the record, here are the methods I ...

How to save ImageMSO icon from Microsoft Office 2007?

I found a lot of nice icons from Microsoft Office 2007. Do you any idea for extract & save all icons as PNG files by using VBA? The following code is code which is used to get image from ImageMSO. Application.CommandBars.GetImageMso([name], [width], [height]) I can display all as PictureBox control and save excel file as web page....

Office Clipboard- status check programmatically ?

I have my own (patched)implementation of IDataObject::GetData say MyGetData. When I copy the data with Office Clipboard on, I get a call in MyGetData by Office Clipboard which tries to get the data to be pasted in its own clipboard viewer window the application which is pasting the copied data. I want to differentiate between these t...

Build a tree like representation of data in Excel?

I have a bunch of raw data in this fashion: Parent | Data --------------- Root | AAA AAA | BBB AAA | CCC AAA | DDD BBB | EEE BBB | FFF CCC | GGG DDD | HHH Which needs to be converted into a tree like fashion. This basically needs to end up in an excel spreadsheet. How can I convert the above data into ...

VBA Code closes my separate .Net Winform App!?!?

The below code is the close routine of an Access App our BA wrote. When executed it is not only closing the Access App but my C# winform app as well, on the same computer. The Access app is named DME Referral and my winform app main process runs in the Task Manager as MATRIX.exe.(Yes I am programming the MATRIX...never allow a group of...

Running a macro in excel

I don't think this is technically a macro but I don't know what else to call it: Users want to print individual sections from a report on a sheet. These sections are just named ranges. Some points: The file is an xlt file. It is used as a template to generate an xls file. I am using Excel 2007, but the users will run a mixture of ...

Forms bound to updateable ADO recordsets are not updateable when the source includes a JOIN

I'm developing an application in Access 2007. It uses an .accdb front end connecting to an SQL Server 2005 backend. I use forms that are bound to ADO recordsets at runtime. For the sake of efficiency, the recordsets usually contain only one record, and are queried out on the server: Public Sub SetUpFormRecordset(cn As ADODB.Connection...

Creating access CommandBar with timer event using VBA.

I have Office 2003. I would like to create Commandbar with timer in MS Access using VBA. What I want is on ever half a second command bar button gets the name of active forms and lists name of forms. How can I do that? ...

Excel VBA Format cell as custom "h"

I have a cell with a time value as 1:23:45 AM and would like to display just the hour value or use it for other calculations. Need to do this using vba. No, I cannot format the column manually. Thanks, Sam ...