VBA stands for Visual Basic for Applications, a subset of Visual Basic used in all Microsoft Office Applications. Consider tagging your question with the application as well as [VBA]

learn more… | top users | synonyms

0
votes
1answer
22 views

How to implement conditional border formatting in Excel?

I need to force cells B, C, D, E to have an upper border IFF cell A is not empty. How can I do this ?
1
vote
1answer
30 views

When using multiple accounts, how to ensure emails are sent from the correct account

I use 2 email accounts with Outlook. One for work, one for personal. The problem I have is I am forever sending work emails from my personal account! How do I set up a list of "do not send email to ...
0
votes
2answers
34 views

How can I find out which parts of an Excel workbook are the biggest in size?

I have an Excel .xlsx that weights 47MB. I'd like to know which parts of the workbook are the heaviest and work them, since I haven't made much progress manually trying to identify and reduce the ...
0
votes
1answer
15 views

Removes rows (based on condition) and copy cells (based on condition)

I have to modify a huge VBA script, I am new to VBA and I must also say that I am not loving it :( I need some help writing an efficient For-loop, let me explain with an example. During the first ...
0
votes
2answers
21 views

Assign triggered code to multiple images - Excel VBA

I wanted to assign some specific actions when clicking on one of the images I have inserted in my Excel sheet. The problem is, I got 52 images (Poker cards for those wondering). So, my question is, is ...
0
votes
0answers
20 views

Export sheets and defined range to PDF

I'm trying to select these sheets in my project: Forside, Begrundelse, handelspris, dokumentation. In my dokumentation-sheet is a range defined in pages and I don't know how to add the defined page ...
0
votes
1answer
28 views

Merge Multiple Excel File

I need to merge a few hundred Excel files into in one Excel file. Each Excel file needs to be merged into its own worksheet in the workbook and the worksheet it's merged to needs to be have the name ...
0
votes
1answer
11 views

Identify Image in Excel - VBA

I have an Excel sheet, and I want to create some macros using VBA. Specifically, I want to change an image with a predefined one, every time I press a button or every time I press on an image. ...
1
vote
1answer
39 views

Getting the index entries of a Word document in VBA

I have a collection of Word docx files in various subfolders. I need to create an index file with links back to the original files. I thought that VBA might be the easiest way to do this. I can find a ...
1
vote
2answers
37 views

Align Secondary Axis Origin with Primary

I am interested in aligning my secondary axis such that it lines up exactly with my primary axis. To be more clear, I want the origins to both line up at 0 at the same place, each preserving their ...
0
votes
0answers
20 views

How do I really enable events in Word VBA?

I've found the instructions to enable events, but this does not always work. When I create a new document from a template events are not enabled. I've got the class module to have word run with ...
1
vote
1answer
20 views

How do I access a new document in vba?

I made a .dot template with a few macros. However, when I create a new document based on the template I run into trouble. If I reference activedocument, I get the message that no document is open. So ...
-4
votes
1answer
53 views

VBA for “IF formula” with multiple results in a single cell [on hold]

How can I convert this to VBA? Using this formula, it cover 6 rows only and the formula is already too long. My report has 600 rows. =IF(AND('Risk & Issue Log'!$K$2=$D5,'Risk & Issue ...
0
votes
0answers
18 views

Convert OO4 ODS to XLSX using Excel 2010 VBA

I am trying to bulk convert OpenOffice documents to Microsoft Office. Using built-in VBA, I use the following code (ODS to XLSX is shown, but same code is being used for ODT and ODP with some ...
-1
votes
1answer
19 views

Format of Row in VBA based on 1stCell and also Compare to above row?

I was wondering how would i through VBA conditionally format the whole row or a row in a range based on the first cell in that row? Also it would require a comparison to the previous row to current ...
0
votes
0answers
36 views

How do I set spacing between paragraphs while keeping numbering in word vba?

I'm trying to write a macro that does the following to a selection: Keeps paragraphs that are numbered numbered Keeps paragraphs that are unnumbered unnumbered Sets line and paragraph spacing Puts ...
0
votes
3answers
33 views

Are there events defined in the word vba object model for these events?

First of all, I did look and did not find any. I want a macro to run whenever one of the following happens: The document is opened The document is saved Text is pasted into the document The ...
0
votes
0answers
40 views

Excel test generator inserts extra data. VBA

I build a random test generator for Excel using VBA. It will randomly pull questions from a test question bank. It will also add the answers in a different cell. However, I found that occasionally ...
1
vote
1answer
37 views

Searching the string in a text sitting on 1 coulmn

I'm very new into VBA coding, I would like to have some assistance as I have been trying for two days, I have got data fixed in column A, I would like to search for a string in that column, eg ...
-1
votes
0answers
40 views

VBA code Excel 2011 on MAC

got Office 2011 for mac and am trying to use the VBA and macro document on it. Unfortunately what works with not problem on several versions of office for Windows, does't work on Excell 2011 for mac. ...
2
votes
0answers
49 views

How do I replace all breaks in a selection in Word using VBA?

I've got a part of a document selected, and now I want to replace all manual page and section breaks (the latter of all types, such as next page even, next page uneven, next page, continuous, column) ...
0
votes
1answer
45 views

How do I select text between two “bookmarks” in Word VBA?

Note: Originally I asked how to select text from a certain point downward, but I've got a solution for that: Dim f As Word.Field For Each f In ActiveDocument.Fields If f.Type = wdFieldAddin And ...
0
votes
0answers
18 views

Macro for hiding table colums, in multipile files, and another on to reverse it

I know almost anything about VBA so I can't really code the Macro that I need for MS Word. I hope that I could get some help here. The basic functionality that I want is to take a Word document with ...
0
votes
1answer
38 views

Excel - How can I highlight duplicate cells in near-matching worksheets?

I'm running a March Madness bracket tournament using Excel spreadsheets. I have one sheet where I will input the actual winners. I have an additional sheet per participant that is near-identical, only ...
0
votes
1answer
36 views

New instance of Excel does not see already opened instance

I have Avizo.xlt with one Worksheet and a code which intended to put this WS inside already opened document, which is SLK report made by our ancient ERP system, and close this document. Everything ...
0
votes
0answers
9 views

Change font of cell automatically without changing font of text already placed in the cell - Excel 2010

I would like to be able to have the font automatically change color when double clicking on the cell without changing the font of the text that is already in the cell. Is that possible?
1
vote
1answer
32 views

How to remove “no cents” when spelling out cents less dollar figures in Excel?

Currently, I am spelling out dollar values using a module from the Microsoft support website. Here is the link http://support.microsoft.com/KB/213360 I am able to spell out dollar values in Excel ...
0
votes
1answer
38 views

Is this possible in Excel? (VBA)

I want to create a VBA macro that will do the following: The Excel file with the Macro should only open when the file is opened from a certain folder in the Windows directory. If it is not opened ...
0
votes
1answer
77 views

Show or hide rows in an excel sheet subject to the value of a particular cell (excel 2007 & Windows 7)

I have made a spreadsheet to specify decoration selections from a range of standard options. There are five separate ranges so this is the first selection then within each range there are additional ...
0
votes
1answer
37 views

How to Replace Words With VBScript Regex and VBA?

what is vbscript syntax for .net: \b[a-z]+\b Hi trying to replace all alpha words in the source. .net regex tester confirms this pattern will find all words: \b[a-z]+\b this: ...
0
votes
1answer
49 views

VBA Excel: Sub procedure to change caption in a UserForm control

I'm creating a user form that shows the value(numeric) of the last used cell in a column. I'm just guessing on how to do it but it doesn't work, this is what I got: Sub show() UserForm1.show ...
0
votes
1answer
74 views

Call PowerShell script from Excel

Excel 2010 I'm trying to call a PowerShell script from a macro in Excel. I have seen a number of examples along the lines of: retval = Shell("powershell ""C:\MyTest.ps1""", 1) When I try to use this, ...
0
votes
1answer
22 views

Autoforward Outlook emails to external only under certain circumstances

Is there a modification that can be made to the VBA code provided in this response from an earlier post that would only forward email from a certain email address rather than forwarding everything? ...
0
votes
1answer
48 views

Can Excel's Find formula have multiple find_text criteria?

I have a list of names on a NAMES tab range A1:A100. On another tab 'Data Export', in column A I have an export of thousands of comments where one of those names from the NAME tab can be found within ...
0
votes
1answer
34 views

How to combine several excel workbooks into a single book

I have several, multi-sheet workbooks which I would like to combine so that I can search them all simultaneously. So, the merged workbook will contain tabs 1,2,3, of the first workbook, then tabs ...
0
votes
1answer
73 views

VBA Excel: Function to find a string in another workbook

I'm trying to create a function that searches a string (bom) in two different workbooks and returns a value next to that string. I know the ranges in those workbooks where I want to perform the ...
1
vote
1answer
35 views

How to know which macro is assigned to a certain toolbar button in Word 2003

I have a Word 2003 toolbar made by someone else long time ago. The toolbar contains lots of buttons and assigned macros. Until now I have been able to set breakpoints in the VBA code in order to ...
0
votes
1answer
31 views

Adding two numbers using macros failed to execute

How to add 2 numbers using macros? I tried below but i am not able to execute. Sub auto_open() n1 = InputBox("enter fiest number") n2 = InputBox("Enter 2nd number") ...
0
votes
1answer
34 views

Passing an element name using a variable in VBA

I have a multi page element on a MS Access form and I am trying to use GetArgs to identify which page to open using the below code. Dim WrdArray() As String If Not IsNull(Me.OpenArgs) Then ...
0
votes
1answer
47 views

How to create a custom “Shapes” menu in Powerpoint

By the "Shapes Menu," I mean the menu that you get to from the ribbon by going to Home -> Shapes. I would like to either: Choose my own shapes for within the Shapes menu, including changing the ...
0
votes
1answer
48 views

VBA Excel: How to select only numeric values in a range?

I used Range.Find to locate a string called "Qty", now I want to select all the numbers in that column. I would use .End(xlDown) to get the last row, however the last used cell in that column is not ...
0
votes
3answers
26 views

Excel: Classifiying data based on a bin system

I'm working with excel 2010 on windows, am a novice excel user but I can program, so you are welcome to throw VBA at me. I have a series of cells where a user can enter a number and another cell needs ...
1
vote
1answer
33 views

VBA Excel: Error during range selection during workbooks iteration

I have several files in one folder with the column "Part Number" but not all of them are in the same column number. The list doesn't necessarily start in the same row either. So I first look for the ...
1
vote
1answer
53 views

Excel 2010 VBA only affecting last row in range

I have some VBA code written in Excel 2010 to force padding around the rows in a table, but part of the code only affects the last row in the range. Here's the full code: Private Sub ...
0
votes
0answers
53 views

How to distribute one (1) Word 2010 template file with [macros, custom ribbon tab, quick style set]

I am developing a macro enabled Word 2010 template: MyTemplate.dotm. At the moment MyTemplate.dotm is mainly containing a ribbon with callbacks to VBA-logic, "native" in MyTemplate.dotm: ...
1
vote
0answers
26 views

From outlook RSS: Download attachment, rename the file and save it to a folder

I know that it should be possible but can someone give me a script to do this? At least some hints how to do it is appreciated.
2
votes
5answers
122 views

Extracting Characters from Folder Path in Excel

I have a huge list of folder paths as text in an Excel worksheet from which I would like to extract the number after each backslash. These numbers then need compiling into a shortened reference. For ...
0
votes
1answer
57 views

Deleting entire row in excel if missing data in certain column or columns?

I just downloaded a Micosoft CSV file from Google Contacts and I would like to modify it so that I can organize the contacts in my phone. I am going back to my "dumb" phone as part of an experiment of ...
0
votes
0answers
37 views

Excel add picture from another worksheet in comment box

I have index worksheet that is used as a table of contents that link to other sheets. I would like to show a preview of the pictures on the other sheets. I learned that the best way to do it is insert ...
0
votes
1answer
124 views

Excel vba code for adding a value to existing cell of sheet

i have this code to add value of a cell to existing value of other cell which is below Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Not (Intersect(Target, Range("E3")) Is Nothing) ...