Visual Basic for Applications; a subset of Visual Basic used in all Microsoft Office applications. Consider using this tag together with the tag for the specific application in question.

learn more… | top users | synonyms

1
vote
1answer
118 views

Disabled VBE command bars

While working with an Excel 2007 VBA addin (.xla), suddenly all the VBE command bars (Main menu, Edit, Debug , ..) have turned gray. I can no longer do things like insert files, block comment code, ...
1
vote
2answers
394 views

Assembling Word Doc using Data from Excel- MS Office 2010

I have a questionnaire that users complete. It is in Excel. After users complete the questionnaire I would like to be able to generate a Word document that contains their answers. For example "The ...
4
votes
1answer
10k views

Word: Resize Image by Percent - Macro

I routinely paste many screen captures into Microsoft Word 2007 and then have to manually resize them to around 75%, which becomes very tedious. The screen captures are all different sizes. I've ...
0
votes
1answer
251 views

How to create tables in word for each row in an excel sheet

I'm creating a word report and all my data is on an excel sheet. The sheet is like this: ID Name1 Name2 Name3 Name4 1 blah blah blah blah 2 blah blah blah blah 3 blah blah blah blah And ...
0
votes
2answers
4k views

Pass values instead of range to VBA Function

I am creating VBA functions in Excel 2007. One has a prototype: Function ToLevelCode_Range(val As Double, ByRef R As Range) I can call it this way just fine and it gets the correct result: ...
0
votes
0answers
109 views

Excel Normal Layout: Horizontally Centered

Description of Problem I have an excel form, which people fill out and submit. I have made it very user friendly, and protected it, even removing the "ribbon" formatting bar at the top. I would like ...
2
votes
1answer
3k views

How to automatically create Excel graphs from Access data [closed]

I have some data in Access from which I have to create Excel graphs every month (data would also be updated every month). So it's creating the same charts with different data every month. Is there a ...
4
votes
1answer
571 views

Read mail attached excel files

Is there an easy way to data read excel files that are attached in emails in Outlook? Im sure this is scriptable, but I dont particularly want to write it. Is there a program out there that can ...
1
vote
2answers
5k views

Is it possible for a macro to open another program?

I am working with a list of 10,000 names, and need to copy info from Excel, paste it into a billing data system, and then paste it into a company data base type system. Next I need to grab some info ...
1
vote
1answer
430 views

Need an event to hook up to for Excel CubeValue refresh

Is there a VBA event I can hook into for cubevalue refresh or update? I'm trying to reconfigure a custom chart axis when the value is returned. I've tried the chart calculate but that doesn't work.
3
votes
1answer
1k views

Random Sampling in Excel

I have an Excel sheet as follows: NO NAME AMOUNT 1 A 50 1 B 50 2 A 100 2 C 100 3 D 70 3 B 70 4 A ...
1
vote
1answer
2k views

autosize excel 2010 comment box when add a lot of text

I'm finding some way to make Excel comment box auto-size when I add a lot of text into it. Some tries with Google and I've got this from Ozgrid but it doesn't work on my Excel 2010. Please help me ...
3
votes
2answers
10k views

Excel Name.RefersToRange: how to check if Name object refers to a range?

The Microsoft documentation says about RefersToRange: If the Name object doesn't refer to a range (for example, if it refers to a constant or a formula), this property fails. I'm trying to ...
2
votes
0answers
287 views

How can I create a Search folder that contains multiple object types in Outlook 2007 from a secondary mailbox?

I added an additional mailbox to my account. I want to create a view that is similar to the 'to do list' view that exists for that user. This means I want a search folder that searches that mailbox ...
3
votes
1answer
5k views

How do I create a VBA macro that will copy data from an entry sheet, into a summary sheet by date

I'm trying to create a macro that will copy data from a data entry sheet into a summary sheet. The entry sheet is going to be cleared daily so I can't use a formula just to reference it. I want the ...
1
vote
1answer
214 views

Creating Custom Sortable datatypes in excel

I want to define a custom data type in excel 2007, a date range. Basically, it's an array of dates or smaller date ranges like: "{ 01-26-1991 , 01-01-2004 to 12-31-2004 , 12-13-2017 }" which ...
1
vote
0answers
658 views

Auto filter refuses to work in locked sheet in Excel 2010

I have a spreadsheet that is used for configuring IP phone system configurations. Bascially I have a table that has the following info in it; Part No. Description Qty Price I ...
2
votes
5answers
4k views

Outlook: apply rules to current message?

KMail has a really useful feature: you can define a series of rules which are only run when you press a keyboard shortcut, and then only on the highlighted messages. This allows me to read a message ...
3
votes
2answers
2k views

Word macro: how to replace strings in a text, based on a 2 column-table?

So I have a series of strings that I'd like to search and replace in Word documents. My strings would be displayed as a two-column table. I'd probably create the table with Word, then would convert ...
3
votes
3answers
6k views

How can I remove the space between dollar sign and value in Excel cell?

I have some cells labeled as euros and some as dollars. For some reason the dollar sign is left-justified with a space between it and the value. The cell is right justified. How can I get the ...
3
votes
3answers
41k views

How do I move the selection down one row in Excel 2007?

Is there a way to move a selected range to the next row? Let's say I have "E9:H9" selected and want the selection to move to "E10:H10". Is there a shortcut for it? The selection should not be ...
1
vote
1answer
952 views

Can the Selected Excel Custom View be determined

I know I can show a custom view in excel with vba. What I need to do is determine which custom view was selected by a user, to alter a column header based upon that selection. They are using this to ...
0
votes
1answer
13k views

Changing color of shapes using vba

I have inserted a bunch of rectangle shapes within my spreadsheet. They are called: Rectangle 1 thru Rectangle 172 Is there some code I could use to change the fill and line color? I would assign ...
3
votes
2answers
5k views

How to make an Excel userForm stay on top

I have a userForm and I would like for it to stay on top of my spreadsheet even when I click within the sheet. Is there some code or a setting that I can use to do this? If so where do I put it?
3
votes
8answers
10k views

Advanced removal of blank rows in Excel

I have a serious problem with a huge Excel sheet which I need to remove blank rows from. My problem is that I cannot use the classic F5->Select blanks->delete, since some of the fields on not blank ...
9
votes
3answers
37k views

Can I make an Excel VBA macro available to all workbooks?

Is it possible to write a VBA script in one workbook, and use it in other workbooks in the machine? I guess I'm looking for a way to write a macro package. EDIT Following the instruction in the link ...
2
votes
1answer
1k views

Is it possible to create groups of objects in Access 2010 forms?

I have a form with 3 option buttons, and about 50 labels, textboxes, and buttons. Is there a way I can group some of these objects so that way when I select an option, some of the objects get disabled ...
3
votes
1answer
1k views

Change checkbox visibility not working

I have the following code hiding rows in a sheet, but the sheet is left with its dynamically created checkboxes still visible. Any ideas? Private Sub SpinButton1_Change() Application.ScreenUpdating ...
1
vote
2answers
3k views

Excel constants — how to reference dynamically?

I am developing a complex spreadsheet for a friend; my first in-depth Excel. Working in Excel 2003. The issue I am having is workin with xl constants , eg xlPaper. The issue comes when trying to work ...
2
votes
2answers
10k views

How to make the FIND function in Excel ignore case sensitivity?

Say I have an Excel sheet of 100 records where there are 3 columns A, B and C. The requirement is I have to get all the rows from column C if the text in column C matches with SQL Server. Here the ...
0
votes
1answer
450 views

Outlook Script to Check for Hidden Attachment

I've got an outlook script which shows you the recipient and prompts the user "Are you sure you wish to send this e-mail to XXX?" However, we have an issue with a plugin we use to send secure files ...
0
votes
1answer
2k views

Use of array formulas within VBA

Excel array functions in worksheets are useful. E.g. for calculating the average of the sin values of an array A1:A5 I enter the following which works nicely: {=AVERAGE(SIN(A1:A5))} Now I would ...
1
vote
1answer
5k views

excel 2010 vba macro ActiveCell.Formula = produces an empty cell when run

This macro formula (in a loop to place a Vlookup formula for each newly inserted worksheet) results in an empty cell when run: ActiveCell.Formula = "=VLookup(""Total Other Operating Expenses"", ...
0
votes
1answer
237 views

Custom Scripts in Outlook

I have the following code that will open up an attachment in in the associated program. I am trying to setup a rule that it will run from a certian email address. The issue is when i choose run this ...
3
votes
3answers
23k views

How to execute a stored SQL procedure in Microsoft Excel?

How can I execute a stored procedure in Microsoft Excel and get all the data it returns?
3
votes
3answers
1k views

Is there a way to set the name box of a cell programmatically in Excel

I would like to programmatically set the name box of a cell in a worksheet I'm working on, either through a formula or through a macro. The end point is that I don't want to set it by hand. In my ...
2
votes
2answers
5k views

VBA code to insert custom signature in Outlook 2007 email

I need to insert a specific signature into an email message. Our support team uses a variety of different signatures to respond to different types of support needs. Currently, I access them via the ...
2
votes
4answers
16k views

How can I create proportionally-sized pie charts side-by-side in Excel 2007?

I have a pivot table with two sets of data as follows: 2011 2012 Slice A 45 20 Slice B 33 28 Slice C 22 2 I am trying to present two pie charts ...
2
votes
4answers
5k views

How do increase row height in excel by X. ie. Add verticle cell padding

I have this report and I want to increase the vertical cell padding to make it easier to read. Now, typically you could just select multiple rows and change the row height until you're satisfied. ...
0
votes
1answer
281 views

How to run macro with parameter from windows command line?

I have a need for running a Macro from the Windows command line with parameter. For example, a macro should save, in A1 cell, the value of the parameter specified. Is it possible to accomplish this?
19
votes
5answers
9k views

How can I use custom colours in the Microsoft VBA editor?

I'm working on a few projects for work using Excel and VBA, so I have no choice but to use the Microsoft Visual Basic editor. I normally wouldn't mind, but I can't figure out how to set a custom ...
2
votes
1answer
196 views

Macro Help: Finding a replacement for Cut and Delete for Speed

I’m looking for a way around using the commands .delete .cut In my excel macros. I’m finding that these processes greatly slow down the procedure (by up to 20 min) for the more data it has to cut ...
0
votes
2answers
4k views

Insert rows into worksheet from another workbook?

I have two workbooks, say: workbook_a.xlsx and workbook_b.xlsx and both contain different worksheets. Two of those worksheets are already linked by a couple of VLOOKUP formulas using a unique key ...
8
votes
2answers
38k views

How do I use a Private Sub in Excel?

I'm want to use the Private Sub functions provided here. Usually a put VBA code in the Visual Basic Editor, I then close the editor and I run the code using "Run this Macro" on the Developer tab. But ...
2
votes
3answers
138 views

Finding the number of specific characters inside a formula

I'm trying to find the number of of +'s in a formula inside a single cell in excel. If it were a normal cell with text inside, this would be quite easy. But due to the restrictions of the file I'm ...
0
votes
1answer
1k views

Open an Access database with scripting disabled (macros and VBA)

Suppose you want to examine the contents of an untrusted Access database. It seems there should be a way to open it in Access with macros and VBA disabled. Searching around the web, I've found ...
3
votes
1answer
463 views

Macro Find: Is there a macro to Format a Word Document as if it were beign created in VBA?

I have a lots of code(for Excel) in Vba and would like to transfer a copy of it into a word document. Does anyone know of a macro that will format the word document to treat the code as if it were in ...
6
votes
5answers
10k views

How to return everything between two characters in Excel?

I'm a programmer with lots of languages, but somehow I've never learned Excel macro or formula language. I'm sure there must be a simple way to do this, but I'm stumped. I have a column of file names ...
0
votes
3answers
2k views

Selecting all data in Excel column regardless of size

I have a repetitive process that I must do in Excel for test data collected. I have to do this process for every data point I collect. I collect over 200 data points each test. My data is auto ...
1
vote
1answer
258 views

Excel userforms

I have developed a macro that does a whole bunch of things for me based on a few things. (Importing files). The file names are dated dd_mm_yyyy and right now I enter them into a sheet where the macro ...