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

0
votes
1answer
11 views

How to insert a button in MS Excel?

Friends I am using MS Excel 2010 and I wish to insert a button in Excel sheet whose name should be ‘1 ADDER’ and I want that whenever I press this button, it should insert 1 in the cell of column A ...
1
vote
0answers
6 views

Automatically Printscreen from result of formula

I have a procedure in VBA to call a PrintScreen: Sub PrintScreen() keybd_event VK_SNAPSHOT, 1, 0, 0 End Sub I want to call it every ten seconds, when the result of this cell ...
1
vote
2answers
23 views

Excel - Find ID-related Value and fill in another workbook

I'm working in a small hospital in India having following problem: For a special drug we're having a list with DATE,ID,DOSE,DURATION,NEXT VISIT which we us as a daily working list (workbook 1), means ...
-1
votes
0answers
24 views

Excel VBA to color cell based on text from another cell on another sheet? [on hold]

I am looking for a VBA that can color a cell in say Column A(Data) or B(Other Data) where the values are pulled from Column A in another sheet containing different Text selected from a drop down box. ...
-1
votes
1answer
17 views

Extracting values from an excel table to build a graph

I have the risk register shown as an excel table. I want to extract the entry corresponding to a specific KRA value and plot its maximum on a graph. I need the method to be automatic so that any ...
0
votes
0answers
19 views

Outlook macro to Open the containing folder of a selected Task List item

In Outlook 2013, I use the "Task List" side bar: From the Mail screen, choose the View ribbon tab. In the Layout ribbon group, click the To-Do Bar dropdown, and select Tasks. Mail items that I ...
0
votes
1answer
20 views

How to shift the data from one cell to another cell in excel?

Friends I am using MS Excel 2010 and I want As I type any value or word in a1 cell, it should automatically be transferred into d1 cell and a1 cell should get blank again. Similarly if i type any ...
0
votes
1answer
29 views

Chart created from range of dates includes dates not in source data

I have a chart and its source data is read from a range which contains dates. When I plot it out into a chart, the x-axis includes dates that are not included in the range. How do I avoid this? For ...
0
votes
0answers
13 views

How can I default the 'from' e-mail address when replying to e-mail in shared mailbox?

I am connected to a shared mailbox and do not have Exchange authorization to send as that address so I would like to reply to all e-mails in that mailbox using my default Exchange account. Is there a ...
0
votes
1answer
33 views

Counting specific words within a batch of Word documents

I need a count of the number of times an acronym (e.g. ‘ABC’) is used in a collection of word documents. The acronym is always three letters and in block caps. All the word documents are contained ...
0
votes
0answers
23 views

Optimize VBA code(efficient code) and ensure distributability

To perform the following actions: Copy a particular "template"-worksheets as many times as the number of cells selected in the master database Create worksheets (with names) based on the selected ...
0
votes
1answer
7 views

Identifying WHICH textbox is being executed

I have a worksheet that has dozens of text boxes. A number of them execute the same macro while a number of others execute another macro, etc. I have five groups of text boxes executing five ...
-1
votes
1answer
18 views

How can I print only pages I have selected by a checkbox to print in MS Word?

I have a protected Word document with many macros. It is approximately 45 pages long. I want to add a checkbox on the top of each page and run a macro so that only the checked pages will be printed. ...
0
votes
0answers
9 views

Macro Hyperlink Error in Mac OS (Office for Mac 2011)

I am getting an error on a macro only when using a Mac. This macro was designed to solve a problem with a formula using the Hyperlink function to copy a link from another sheet for each row. (Excel ...
0
votes
1answer
49 views

Creating Folders and Subfolders from excel cell values

Im trying to create a directory named after the value in column E within a directory (c:/Site Information), then create a further directory called the concatenated value of column A,B,C, and D. This ...
0
votes
1answer
26 views

Running macro on multiple sheets

I can run macro on individual worksheets but not all open worksheets. I want to run this macro on 700 worksheets. We are trying to delete one column. Sub RunMacroOnAllSheetsToRight() For i = ...
1
vote
1answer
23 views

Macro to Copy Hyperlink from Another Sheet [closed]

I have a Macro that I found on this site to copy hyperlinks inserted through the ribbon to a different column in another sheet. However, the macro is only working on the first row. I added Do until ...
0
votes
2answers
33 views

Needs VBA solution - Clear contents of 4 cells to left of cell with N/A Error

I have a table of data in which column L has a vlookup formula. In the rows where column L (i.e., the vlookup returns "#N/A"), I would like to clear the contents of the eight cells to the left ...
2
votes
1answer
47 views

How to convert formatted text in a Powerpoint table cell to HTML

I want to convert a table in a Powerpoint slide to HTML. I know how to put in the table tags, but cannot work out how to convert formatted text inside the table cells to HTML. So, for example, how can ...
2
votes
0answers
37 views

Append values to Access table from excel with ID autogenerated

I have a access database with some tables which get updated daily with some values. I need the tables to have a ID field which is autogenerated when the other values of the table are imported from ...
0
votes
0answers
26 views

How to export images from Excel table [duplicate]

I have an Excel table with two columns: id and picture. id is a string and picture contains a single jpeg picture. This table contains almost 1,000 rows. Is it possible to export the images as jpeg ...
0
votes
0answers
30 views

Excel, macro move one row down and then delete the row

I'm trying to clean up duplicate rows. My data is in a table with filters applied. I have tried using the Excel feature to remove duplicates, but get the following error. Cannot complete ...
2
votes
0answers
17 views

How to return results of SQL query to Excel sheet with VBA function [duplicate]

I'm trying to create a VBA function in Excel to affect dynamic value from Access to Excel sheet. This is my code. Public Function SQL(DB As String, Query As String) Dim conn As ADODB.Connection ...
-2
votes
1answer
22 views

How can I find cell with minimum value in a column and add the values next to it to another range?

I have values in range A1:A3 and also in B1:D3.I would like to find the cell with minimum value in range A1:A3 and to add the all row values next to that cell to another range by hitting a command ...
1
vote
1answer
45 views

How can I replace forbidden characters in a file names before saving in VBA?

This will be very simple for somebody who knows VBA better than me. I used a code original provided by user Nixda on this forum to split excel worksheet into multiple CSV files based on column value ...
0
votes
1answer
31 views

Web Scraping Macro error

I am trying to scrap multiple pages that are a search result of a key work. I wrote this code but I am getting an error when I run it. Error: Application \-defined or object-defined error. When I ...
0
votes
2answers
43 views

How to give worksheet tab a color if range of cells contains text

I have tried code that I've found on SE, and elsewhere but they aren't working as I think they can. I'll list them below. I'm almost certain this is an easy question. What I'm trying to do: If in any ...
0
votes
1answer
16 views

Converting a column list from A2:A142 to a list with commas into cell B1; holding a format as “0000” with leading zeros

This code works to convert the column list to a concatenated list with commas, however the format doesn't have leading zeros while the VBA loops in B!. Dim i As Integer Dim s As String i = 2 Do ...
1
vote
1answer
22 views

How to paste static value, not dynamic value in VBA

How do I change this piece of VBA code such that instead of =datewanted in the excel cell, I get the static value of the "datewanted". ws.Range("A" & lastRowofA & ":A" & lastRow).Formula ...
0
votes
1answer
30 views

Copy named ranges to another workbook

I have this VBA code to copy my named cells from one workbook to another, but it gives me Error 9: Subscript out of range. Any ideas please? Sub namexfr() wbs = ...
-1
votes
0answers
24 views

Outlook macro for printing the first page of an email?

I need to print the first page of every email I get at my work and I'm trying to figure out how to make a button for it like the quick print. It just needs to go to the default printer and print only ...
-1
votes
0answers
20 views

Deleting columns from Excel [duplicate]

You responded to a question on How to delete specific columns from all excel workbooks in a particular folder. When I tried to use it, an error said that "Title" was undefined. Thanks for your help. ...
-1
votes
0answers
21 views

Mass edit hyperlinks on a Microsoft Project file

We had to replace our file server and long story short, user had Excel sheets and MS Project files with hyperlinks pointing to the old server which are now no longer working. I was able to find an ...
0
votes
1answer
16 views

How can I create multiple spreadsheets using the value of a column?

I have a workbook (Req_PO_Log_V2.xls) that has all of the expenditures for our repair and maintenance funds from our current FY. The lay out is as follows: | Date | Req Number | Acct | Vendor # | ...
0
votes
1answer
39 views

Run EXCEL VBA code in separate workbooks in sequence

I have seven Excel workbooks that have macros to update them, and these are to be run every week. I want to create a macro that runs each one sequentially (and closes the previous one as some subs ...
0
votes
1answer
25 views

Force Outlook to Send Mail on or after a Specific Time

Need VBA code to send Outlook e-mail at 2.30pm, if after 2.30pm send straight away? it would need to precede Application.Dialogs(xlDialogSendMail).Show
0
votes
1answer
41 views

Outlook 2013 VBA rule random failures

My goal is no make Outlook delete all mail from a specified address keeping maximum 3 latest (it really helps with some daily subscriptions like coupons, etc.). I have lots of rules sorting mail into ...
2
votes
2answers
78 views

Excel 2013 VBA programming

I'll start off my saying I'm trying to save time for a family member who is doing this program manually. Sheet 1 Column A is a start date Column B is a projected start date Column E is a Task Name. ...
0
votes
0answers
60 views

Excel: Create a Collapsible Master-Detail View From Another Sheet?

I'm designing an excel template for importing data (into another DBMS). The problem is, the data will be separated (normalized) into several tables in my DBMS (master-detail model). Let's say I have ...
0
votes
0answers
14 views

Changing cell style groups

I was sent here from stakoverflow When I create a new cell style in Excel, it goes in a group called Custom. The standard groups include Good, Bad and Normal, Data and Model, Title and Headings, and ...
0
votes
0answers
16 views

Access 2013 How to prevent from saving a record

I had created a form in access 2013 to add records to a table but I'd noticed that if I close the form without saving the record access still saves it to the table anyway. I would like to know how to ...
0
votes
0answers
21 views

Control MS word add-ons using recorded/programmed macros

I have installed a Microsoft word add-on (Docear4Word - I think originally written in C#). The program installer places the program on the references menu of the ribbon although the buttons and ...
0
votes
0answers
21 views

Outlook - strange item.Attachments error

I have the following code, that should save a specific Excel file attached to an email. The code is combined with a rule, that triggers this script when an email with a specific subject is received. ...
0
votes
3answers
64 views

Excel macro: Last non-empty cell in a column

This is a followup question to this one. The following formula can be used to find the value of the last non-empty cell in a column, in Microsoft Excel: =LOOKUP(2,1/(A:A<>""),A:A) My ...
0
votes
1answer
117 views

excel 2010 Vba, looping through named ranges, Run-time error '1004':

I am assigning the same Macro to several OptionButtons. I try to determine in which named Range the cklicked OButton is located. So I get the Cell of the Button and loop through all named Ranges in my ...
1
vote
1answer
34 views

How can I assign Excel keyboard shortcuts for macros that use keys other than Ctrl + {alpha character}

I would like to assign keyboard shortcuts to Excel macros that use keys other than the standard Ctrl + {alpha character}. Based on this post it sounds like it is possible but I am not sure how: ...
1
vote
1answer
36 views

Show increase in trendline by using Excel vba

I have data in c5:c12 (sales1) and I plotted a graph and a trendline of this data. I also have data in d5:d12 (sales2). I would like to show an increase, graphically, in my existing trendline by using ...
0
votes
1answer
20 views

run macros assigned to many excel sheets of a workbook, with one click

I have one workbook with 8 worksheets. I have a macro assigned to each worksheet. I want to run all 8 macros from one worksheet in one click(by clicking one button, to run all 8 macros). How can ...
1
vote
3answers
25 views

Line of text is too long in VBA

I'm trying to write a macro to send a canned reply. The issue I'm having is that the body of the text is too long to fit on one line in my code. I have no idea how to have a second paragraph of body ...
0
votes
1answer
44 views

Excel VBA: How to use a unique username or save location for an export pdf macro

I have a macro that prints a uses the internal Excel method ExportAsFixedFormat to print a worksheet as a pdf and save the document to the desktop using a unique file name structure. ...