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

1
vote
1answer
39 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 ...
2
votes
0answers
128 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
384 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
26 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
91 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
40 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
10 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
43 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
50 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
427 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
134 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
79 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
621 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
53 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
105 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
56 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
906 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
45 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
38 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
47 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
75 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
178 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
46 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
58 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
181 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
92 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
41 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
165 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
286 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
52 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
2k 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) ...
0
votes
2answers
151 views

Excel 2010 formula, How do I write this formula? (VBA)

I need a bit of help from the more experienced Excel VBA users. Basically I have 2 groups of 3 cells (6 cells total) If one group of 3 cells is filled in it needs to accept it and not return a ...
1
vote
1answer
154 views

Excel 2007 VBA code to aggregate data based on conditions and calculate a weighted average

I am importing data from a trading system that has buy and sell orders for multiple securities(stocks). I need to aggregate the same security buy orders and the same security sell orders, creating a ...
0
votes
1answer
3k views

Split Excel worksheet into multiple worksheets based on a column with VBA

Question is simple and may be repetitive. I have an Excel workbook which contains around 50 columns I have a criteria column for splitting this workbook into mulitple workbooks The approach is as ...
0
votes
1answer
45 views

How to call a namer range using a variable to define the name

According the documentation, any quoted text names can be defined by a variable If I define Set xlsDataSource = Application.Workbooks("New_TOR_V1.xlsm").Names("MyRange").RefersToRange it works as ...
1
vote
2answers
30 views

Workbook doesn't find macro

I created a macro in a workbook which is being used by several persons on their own computers. For some of them, it seems to work fine, but for other a message appears that it can't find the macro on ...
0
votes
1answer
146 views

VBA string search within files in directory not working in Excel 2007

I'm trying to look for a string within a folder containing several files. Once the string is found it should select and copy a value in an adjacent cell 5 columns to the right(Offset(0,5)), then paste ...
0
votes
1answer
97 views

Outlook 2010 Run Script via Rules

I have the following subroutine in ThisOutlookSession: Sub receiveMtgRequest(Item As Outlook.MailItem) MsgBox "You have received a meeting request: " & Item.Subject End Sub I have set it to run ...
0
votes
0answers
78 views

Outlook VBA not recognising Inbox subfolder

There are 3 email addresses controlled by Outlook. When an email arrives to a specific email account, a specific word in the subject line directs the email to one of 2 sub-folders: PHY2048 or PHY2049. ...
0
votes
1answer
93 views

How to merge rows with same Name merging data of each ?related column

I need to merge rows with same Name preserving data of each column. For example, if we have two rows with the name "Mr Bean" on the first column "Name" then merge data of each column related to rows ...
0
votes
1answer
239 views

How to combine values from multiple rows into a single row using module?

I'm looking to combine multiple rows into a single row based on a value in the code column.. I've noticed other questions on here similiar to my question but I cannot seem to extend the range.. Code ...
4
votes
1answer
302 views

Using English macros in French version Excel

I am currently in France and am using a computer on which all Office programs are in French. I need to use a Macro which has been written in English VBA, but it fails. I assume the issue a language ...
0
votes
1answer
276 views

Macro to Import CSV files into Excel

I have a bunch of CSV files in a folder. I'd like to import each file into Excel using the 'Import from Text' tool by typing the name of the file into a cell. I then need to format all of the data ...
0
votes
1answer
276 views

How to format cells between two dates with a colour based on a value in vba?

(apologies if this question is difficult to understand, i'm unable to post an image) I've tried finding a solution for this online but haven't had much luck. Ideally, I want to use conditional ...
0
votes
0answers
77 views

I'm looking to create some VBA code to search for other instances of certain string, move original instance above found

Please excuse me if I'm posting incorrectly in any way- this is my first go round on superuser. I'm looking to create a fairly basic VBA macro to automate a process in excel I'll otherwise have to ...
2
votes
2answers
78 views

VBA Syntactic Sugar

I use VBA in my work every day, but I didn't know about Range syntactic sugar. I just knew last month when I saw MSDN Range page. I tried to find an article with this features, but I didn’t find any. ...
0
votes
0answers
60 views

MS Access Personal Macro Workbook

In MS Excel I have a personal macro workbook that is with me no matter what excel file I open. Is there a similar solution available for MS Access? The reason I am working on this is that i want to ...
0
votes
1answer
139 views

How can I create a persistent data connection from MS Project 2013 to Excel 2013?

I'm trying to get dates from an MS Project file to come across to a separate Excel file which I'm using to run conditional formulae on to handle the project status matrix. The catch is that I need ...
2
votes
2answers
159 views

VBA Excel 2007 help to speed up code to hide rows [closed]

I am trying to write a VBA code that automatically hides rows if a value in the row is equal to "". My range of values is A37:A400. Because my range is so big my previous VbA is to slow and looks one ...
0
votes
1answer
58 views

Changing the color of a shape every 5 seconds in excel using VBA

Hello I am looking for the VBA code to change the color of a shape in Excel using VBA every 5 seconds from when I click a button. the name of my shape is "Rectangle 1".