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
35 views

Outlook 2007: Is There an Event That Fires If a Rule Is Being Enabled or Disabled

I have written a bunch of macros that allow me to enable or disable a specific Outlook rule (i.e., delayed sending of messages) via a toolbar button. They also change the button's appearance to show ...
0
votes
1answer
167 views

VBA code to select the first shape in the current active paragraph

In Word 2013, I need a simple VBA code in my macro which selects the first shape that exists in the current active paragraph. Note: the shape that I need the code to select is a custom shape that I ...
1
vote
1answer
190 views

Using a loop to extract data to excel

first timer here and I'm new to Excel 2013 so if I screw up somewhere let me know! I am trying to gather stats from the Detroit Red Wings from 1932-2014 I recently learned that I can pull data from a ...
1
vote
2answers
1k views

Macro for cleaning all sheets in a workbook (VBA - Excel 2010)

I have a macro file with 5 sheets and I would like to add a VBA command button into the same file to clean all workbook contents with a single click. Does anyone know how to do it by using VBA on ...
0
votes
2answers
26 views

Why is using this code to replace a formula giving me an error?

In Excel I use the following to clear cell E5 and replace it with the word name. Sheets("Invoice").Range("E5") = "Name" I can also use the following to replace G11 with the VLOOKUP code I have here ...
0
votes
1answer
21 views

Create a spreadsheet that filters data and allows users to edit filtered data

I have a master datasheet with lots of information. I extract data from the master to a simple overview pertaining to only specific groups of people which takes this data and calculates other ...
0
votes
1answer
65 views

Macro to merge data on to template

I am attempting to basically do a mail merge in Excel. I would like to take employee data from one Excel worksheet and populate fields on an Wxcel template. So far I have written code to open the ...
0
votes
0answers
46 views

Show Excel column filter information in cells - Not working

I am on a W7 64bit pro edition, on a Lenovo T420 With regard to Show Excel column filter information in cells, is there a reason why it is not working in Excel 2003? Thanks in advance Gilberto PS I ...
0
votes
1answer
104 views

Open multiple independant instances of Word 2007

Since MS Word 2007 there seems to be a change in how Documents are opened. In older Versions, each Document could be opened in a completely independant Word Window. Now, all seem to be opened in one ...
0
votes
0answers
31 views

XL 2003 crashing on ANY VBA code in ANY class module - code module OK

Any sub in ANY class module including ThisWorkbook, an added class module, or even the worksheet class modules all crash IMMEDIATELY upon launch of XL 2003 or upon invocation via control or button. ...
0
votes
1answer
218 views

Copy Active Cell Comment in Excel into a new word file

i do not know much about Macros, is it possible someone could help me out. I have a simple excel file with names of Clients that have a lot of comments on each name. is there a fast way other than ...
1
vote
3answers
69 views

Checking whether a label exists between two other labels in a column

I have a column (call it A) in Excel lists off different items and their properties. Every item has the word "Type" associated with it and so there is a cell with that label in column A so that in ...
1
vote
1answer
88 views

Excel VBA to add cumulative total to new sheet

I am trying to create a workbook that creates a new page and puts the cumulative total from two cells to add to the new totals entered on the new page. I've been able to create a new page, but can't ...
3
votes
0answers
270 views

Excel VBA : SQL query handles error

I have SQL that I can use in Excel 2013 to get the info from the Access database and it works using the SQL directly in a connection, but now I want to run it from VBA instead so I can use some ...
-1
votes
2answers
53 views

Empty email content with macro

Using the thread Here I have created a macro that will open up a template in a new message window. My signature is still at the bottom though. I want to empty the email content before adding the ...
0
votes
0answers
88 views

Ideas on how to automate the export of cell values from 300 different excel workbooks

I have 300+ excel workbooks, containing some informaiton. I need to construct a dataset, containing information from each of the workbooks. To clarify, let me give you an example: -WB1.xls contains ...
0
votes
0answers
38 views

Need to modify VBA slightly but not sure how

Currently, I have some code to extract data from a webpage. It works perfectly for one of them. This is the existing code Sub GetPrice() Dim IE As New InternetExplorer IE.Navigate "THE URL ...
0
votes
0answers
72 views

Update Combobox Fields via an Access 2013 Form

Simplified version: I would like to update a table field based on a combobox: SELECT [Table].[ID], [Table].[Name] & " " & [Table].[Year], [Table].[Info1], [Table].[Info2], [Table].[Info3] ...
1
vote
1answer
219 views

Macro: Insert a new row above a cell containing a different numbers

I have an excel with two columns. Column A contains numbers and column B contains text data. Numbers are continuous like 1 2 3 with several blank cells between them as shown below. For example: 1 ...
0
votes
1answer
43 views

Hyperlinks in Cell Not Emplying Full Use of HTML

The following is on Excel 2013. I have a spreadsheet that, through a VBA macro, takes a numerical input from a cell and appends it to a hyperlink to a PDF document on a website immediately after ...
0
votes
3answers
2k views

Excel VBA or Formula to convert text to Date with Time type

I have a quite a number of data where its date/timestamp has been imported into excel as text. Excel does not really recognize it as date with time. e.g. 25.08.2011 16:17:59 (mm.dd.yyyy hh:mm:ss) ...
0
votes
1answer
138 views

Track username and date when the sheet open

I'm using VBA to display a welcome message with the username. Additionally I want to keep track of the username (taken from environment variables), date and time in one of the sheets. For example: ...
0
votes
0answers
71 views

VBA code to paste value to an indexed position from a match on different sheet

I am struggling for days to make this excel formula work from a command button. =IF(‘Machine Status’!E$28=(INDEX('Import Pool'!$A:$H,MATCH(‘Machine Status’!$B$23,'Import Pool'!$G:$G,1),2)) then cut ...
0
votes
1answer
45 views

excel copy past repeat macro

At the moment I am working on a research project for my university in excel. Now I have a certain range BF1:DJ293 which has to be copied and past for 238 times to the right. So this range has to be ...
0
votes
0answers
39 views

Auto Filter automatically when entering new data

I am new to VBA and are currently working on a little project for myself and got stuck at the following point. I have two sheets that I am working in and this is what I would like to happen. I have ...
0
votes
1answer
129 views

How to generate inverted normal random numbers in VBA?

I am trying to generate 5.000 random variables using these excel functions: normsinv(rand()). This is the code I wrote: Dim r As Integer r = 1 For r = 1 To 5001 .Cells(r + 1, 1) = ...
0
votes
1answer
49 views

Random Numbers in a Range of Cells

I want to generate random numbers in my model. Every time I run the macro my cells range "G8:H34" have to fill in with different random numbers that should be integers from 0 to 2. I have to generate ...
1
vote
1answer
54 views

Sorting every 7 rows till end of worksheet

I have a worksheet with five columns A-E and nearly 10,000 rows. I need to sort every 7 rows till the end of worksheet using data in column C. The following code does the job for the range A1:E7. Can ...
0
votes
0answers
276 views

VBA adding rows and deleting rows automatically when changing start/end year

I have 3 tables I would like to change number of rows as I update the number of years. Whether I change end year or start year where the table can flex. The problem I have encountered so far is that ...
0
votes
4answers
2k views

Combining all combinations of data from three columns in excel

I have a few columns of data that I would like to combine, and get each unique combination. Concatenating across a row or set list is easy enough, but I would rather not have to enter each possible ...
2
votes
0answers
46 views

VBA substitute for Microsoft Office RT?

I've been working on VBA-based applications for automating Excel and other MS Office applications. Now I'd like to expand to MS Office RT, but I've read that Office RT has no VBA support. Is there any ...
-1
votes
1answer
70 views

How Can I Comment a Block of Text in Microsoft Office Visual Basic Editor?

Sometimes when I'm writing a macro in Excel's Visual Basic Editor (VBE), I want to comment out a block of code to test the macro without it. I know I could go to each line and type an apostrophe ('), ...
0
votes
1answer
46 views

how to make a Copy formula, Value from A3 to B3 if z3 = csl

Is it possible to have a formula that can copy text value from A3 drop down list of cars, paste the text Value into B3, once i put CSl into Z3. then i can delete A3 but still have the text Value in ...
1
vote
1answer
1k views

How to create a macro in Outlook 2010 to add the the date to the subject line

I am new to the VBA format of writing code and I have been researching how to get the current date to AUTO input into the Subject line of an email when commanded. I need to know how to complete the ...
0
votes
0answers
147 views

How do I bulk replace a hyperlink containing a File:\\ command in excel

I work with Sharepoint 2007 and Excel 2007 In SharePoint I sometimes use a hyperlink with the file command like; (file://\\group.net.dk\sites\S01625\stt\Drawings). This is useful when I want to open ...
0
votes
0answers
363 views

Trying to get VLOOKUP to get data from a table array on another workbook where the worksheet name is variable

I currently pull data in from 4 workbooks using the INDIRECT function, the formula is as follows, =INDIRECT("'[" & $AE$1 & "]" & $AA$13 &"'!" & $AI$1) $AE$1 contains the workbook ...
-1
votes
1answer
93 views

VBA not recognizing MsgBox property VbMsgBoxStyle

I'm getting the error message "Compile Error: Named argument not found," when I try to run my VBA code. VBA doesn't seem to recognize the last property VbMsgBoxStyle. Dim dump As VbMsgBoxResult dump ...
0
votes
1answer
121 views

VBA Validate input in the input box

I need an input box that will provide a value that is an enumerator. MSDN Does not mention validating the fields at all. Is there a way of doing that? Like in HTML5 the pattern in input tag? Here ...
1
vote
0answers
45 views

Link Microsoft Excel to Word document

I need to link certain numbers in my word document to an excel file that I have. For example, the Revenue for FY2014 is "20,000". I would like the 20,000 to be linked to a certain cell in an excel ...
0
votes
1answer
108 views

Macro to create a text file with values from cells and text

Im trying to create a macro in excel that creates a text file which some of the parameters are on excel cells. The output would be for example: The kid is 'cell (1,1)' old. His name is 'cell ...
0
votes
3answers
36 views

How to record in adjacent cell what my drop down selection was, as a Hard Record formula? plz

is there a excel function coding which can record in an adjacent cell what my drop down selection was From cell A3, into Cell B3, but to keep this even if i remove the drop down selection at a later ...
0
votes
1answer
454 views

Excel VBA Date format: Hyphen as separator gives wierd substitution result

Excel 2007. I want a macro to put today's date in the current cell formatted as dd-mmm-yy, e.g. 30-Oct-14. The code I have is simple : 'ActiveCell.Value = Format(Now(), "dd-mmm-yy")' For some ...
0
votes
1answer
124 views

Inserting Autotext (or Quickpart) into Word (2013) on the basis of a Boolean value from Access (2013)

Haven't found any info on this anywhere on the net (at least any that works--more on that in a moment). What I am trying to do is have, at the push of a button that I have created in an Access Form, ...
0
votes
0answers
144 views

Trying to start a file upon opening Excel 2013 using XLSTART

How do I get excel to load an certain file using xlStart. I found C:\Users\mdowney\AppData\Roaming\Microsoft\Excel\XLSTART Added the file and its not working.
0
votes
1answer
57 views

How can excel take two seperate cells with comma seperated data and pair them up?

I have looked all over for an answer to this and seem to be stuck fast. I have something like this: Cell B1: 01/01/2014,01/02/2014, 01/03/2014, 01/04/2014, 01/05/2014, 01/06/2014, 01/07/2014, ...
0
votes
1answer
38 views

Adding another value in Excel cell/column if another cell has particular value

I wanted to be able to create a macro to change the value in Cell B to EPTBSIET if it equaled that value in Cell E - SIETCO. I've been able to compile an IF formula but would rather have the value not ...
0
votes
2answers
149 views

How To Extract Pattern from a folder path (VBA Excel)

I'm pretty new to vba excel and trying to reorganise a very large file structure. Basically, all our equipment has a tag in the form of [A-Z][0-9]0-9][0-9][A-Z] e.g. J452G being a compressor. Every ...
0
votes
2answers
1k views

VBA code to select certain worksheets in Excel and save as new workbook?

Is it possible to use VBA in order to select certain worksheets in an Excel workbook and save as new workbook file?
1
vote
0answers
38 views

Verify word document by vbscripting

Do you think vba will help me learn how to verify a word document by vbscripting. Or I have to strictly learn vb scripting for word documents. My main problem is I want to start verifying from line 7 ...
1
vote
2answers
653 views

Outlook VBA macro to forward email attachment, but delete message body

I am trying to add a custom action to a rule in Outlook where a message is automatically forwarded and the attachment stays but the original body message is deleted. I need to write code for the ...