vba

MS Excel 2003 - Anyone know how to delete rows that contain duplicate data?

I have an excel spreadsheet that has about 18k rows and three columns. I want to use this as a key in an Access database. So the three columns are [IDKeyNumber] [Name] [Category] The problem is in certain places the IDnumber is duplicated because the category has two category codes (typeA & typeB) All I really need to know how ...

How do I put data from multiple records into different columns?

My two tables are titled analyzed and analyzedCopy3. I'm trying to put information from analyzedCopy3 into multiple columns in analyzed. Sample data from analyzedCopy3: readings_miu_id OriginalCol ColRSSIz 110001366 Frederick Road -108 110001366 S...

conditional formatting or formatting with VBA

In MS Access, is there a reason to prefer conditional formatting over setting formatting options with VBA? Is one more effecient or generally considered easier to read? ...

How do I apply a style to multiple selections in Word using VBA?

I created a macro that will apply a particular style to whatever is selected in the document. However, when in draft view, when the user clicks in the style area pane to select a paragraph and then Ctrl + clicks on an additional paragraph, this additional selection is not applied when this macro is run: Sub BodyTextApply() Selection...

Access 2007, VBA, a tiny project for a school, and the Trust Center

A friend asked for my help putting together an Access database for a small department at a university. It tracks medical info on some animals. The problem is that to make the application easy enough to use, we had to write some VBA code to glue different forms together. When we open the database (or a new, updated version of the database...

Access Vba - To find null and blank values

I am trying to find the blank values and null values in a table. I am using Asc to assign the values of the table to a variable and then based on their ASCII values differentiating null and blank. But I am getting "runtime error 94: Invalid use of null" when the code tries to read the ASCII value of a null field. ...

Applying filter based upon ActiveCell on a different Worksheet

Hello, The following VBA code sits in a worksheet called "SCU" and the cell "C4" is the information I would like to filter on. When double clicking on "C4" this takes us through to the "Account Data" sheet and attempts to filter on the active cell, however as it's on a separate worksheet I get the wrong data in the filter (Not "C4" in...

Why is the Date format changing?

I have an Excel spreadsheet where there is a date column, and the date is entered in the format of dd/mm/yyyy. When I open this file in My Excel, the Date column converts to date, but in the format of mm/dd/yyyy automatically. i.e., 12/03/2009 4:44:44 (12March) but it takes it as 3rd Dec 09.. Would you please shed some light on the ma...

How can I find the width of the parent window in MS-Access

I'm trying to force an MS-Access form to take a certain position relative to the right edge of the main window (actually I want to center it, but I can see also wanting to dock it to one side or another). I can reposition the form this with Me.Move, e.g., Me.Move newWindowLeft, newWindowTop, newWidth, newHeight However, how can I ...

Providing in-form help in MS Access

I'm a non-developer building a simple Access 2003 database for an NGO that works in developing countries. I would like to provide in-app help (what certain fields mean, for example) in a number of forms and on the switchboard. I'm not sure about the best way to do this - not just on a technical standpoint but to increase user-friendlines...

Serialize MS Access Database Objects to Text File(s)

Is there some code out there that lets me serialize all the objects in an MS Access MDB File. All the Objects like Table definitions, Table Data, Query defintions, Report definitions, VB Modules should be written to one or multiple text files. It is not necessary to reverse the operation (but would be nice to have). I want to put the t...

Access 2003 - Front End GUI Display question

Just wondering, is there a way to tell access to only display the forms/reports without displaying the access window itself (the "shell" window that the access forms populate inside of). just wondering. ...

User Defined Functions in Excel and Speed Issues

I have an Excel model that uses almost all UDFs. There are say, 120 columns and over 400 rows. The calculations are done vertically and then horizontally --- that is first all the calculations for column 1 are done, then the final output of column 1 is the input of column 2, etc. In each column I call about six or seven UDFs which call o...

How to insert color in Word?

How do I insert a text with color. The code below will only insert normal text. oDoc.Range.InsertAfter("Text Input One") ...

How to get all filtered data rows in excel (with hidden columns)?

My data sheet has filters and hidden columns. When filter(s) applies, I need to loop through all filtered data. I use: Excel.Range visibleRange = this.UsedRange.SpecialCells(XlCellType.xlCellTypeVisible, missing) as Excel.Range; Now visibleRange.Rows.Count is 0; use foreach loop "foreach(Excel.Range row in visibleRange.Row)" row d...

Iterate over VBA Dictionaries?

I'm using the Dictionary class in the MS Runtime Scripting library to store where labels are going to go for a report template. Is there a way to iterate over all the key value pairs in that dictionary like in Python? I just want to use the key as the row number (It's all going in column A) and the value will be the label header. Some...

Excel - "File Not Found: VBA6.DLL"

I have an Excel 2007 Sheet with Macros. When I click on a button, it immediately pops up an error "File Not Found: VBA6.DLL" Problem is, I have been using this sheet forever, and never seen this problem before. I did make some very very minor changes to the Macro code. And, I have 2 other sheets with identical macro code which I made t...

print document programmatically with VBA in Outlook 2007

Hi SO, I'm looking for a way to print a Word document programmatically with VBA in an Outlook macro. I think there may be two ways to accomplish this: 1) Use the Shell to print the document via command line switch with Word. 2) Use Outlook the print the document. Is there a way to do this? I need to be able to specify the printer. T...

How to test for existence of VBA in Excel workbook, in VBA ?

I am writing a reporting tool to document Excel files for various "compliance criteria", including wkb.VBProject.Protection to report if the VBA is locked. But how can I find if the workbook HAS any project ? If I calculate wkb.VBProject.VBComponents.Count - wkb.Worksheets.Count - 1 '(for the workbook) that will give me the number ...

svn api to access repo files from VBA

I'm new to VB and SVN and involved in writing automation scripts in VBA. I've got a requirement where we need to 'retrieve ,checkout ,add ' files to SVN remote repository from VB code in background as part of automation. Please can anyone guide me what needs to be done. Any libraries , projectsetup ,code ,links, info you can share to s...