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
votes
1answer
23 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
9 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
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 ...
-1
votes
1answer
19 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
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 ...
-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. ...
2
votes
2answers
1k 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
1answer
31 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 ...
1
vote
0answers
4k views

Missing macros in Word 365

I'm hoping someone can help with this problem. I've just upgraded from preview to Office 365 and the problem is present in both versions (but not in the Office 2010 that I was using before). Whenever ...
1
vote
1answer
4k views

Prevent Excel 2010 user from pasting formatting into cell

Is there a way to lock a cell so that a user can copy/paste a value into it, but not copy formatting to it? Locking the worksheet doesn't prevent the user from changing the formatting of the cell by ...
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
0answers
14 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
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 ...
0
votes
0answers
24 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 ...
6
votes
11answers
49k views

Copy Excel worksheet and maintain relative cell reference in formulas

Another copy problem in Excel: How can I copy a Worksheet from WorkbookA.xlsx into WorkbookB.xlsx without the copied Worksheet still referencing WorkbookA.xlsx e.g. the formula =B!23 becomes ...
0
votes
1answer
50 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
4k views

Call PowerShell script from Excel macro

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
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 ...
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 ...
1
vote
1answer
45 views

Excel VBA code to add an extra row

I am creating VBA code in Excel to add a row and format it. I need the value for "i" to be a variable (instead of 20 as shown) depending on the number of entries in the first column of my Excel ...
0
votes
1answer
5k views

How to customize Paste Value Excel Short Cut

I was reading in this other post how to set up VBA code to paste values in Excel. I understand how to create the VBA code. I would like to set the keyboard shortcut to Ctrl d but Excel pops up an ...
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 ...
1
vote
0answers
208 views

Microsoft Outlook 2010 - moving emails with specific number in subject to a specific folder with the corresponding number

I get emails in shared inbox containing a number in the subject (like 9921635). These emails are archived to subfolders, which are part of the shared inbox, that also contain this number. Sometimes ...
2
votes
2answers
4k 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 ...
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 = ...
0
votes
1answer
946 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
1answer
919 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 ...
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
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 ...
3
votes
1answer
3k views

Macros in Excel 2010 hangs

I have a spreadsheet with several macros. Generally, when previously using Excel 2007, a user clicks a button and everything works as expected (calculations, some email sending & file I/O). ...
0
votes
3answers
1k 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 ...
0
votes
1answer
42 views

Which ODBC connection properties have higher priority ?

I take data from PostgreSQL via ODBC and put the data in excel worksheet. For this I use VBA which makes a query table. In the VBA script I specify a connection string which contains some ODBC ...
0
votes
1answer
9k 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
1answer
3k 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 ...
2
votes
1answer
48 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
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 ...
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 ...
-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 ...
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
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 ...
2
votes
0answers
38 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 ...
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 ...
-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 ...
6
votes
1answer
3k views

How to auto advance a PowerPoint slide after an exit animation is over?

PowerPoint entrance animation set up with "Start: With Previous" starts right when a new slide is advanced. However, if you set up an exit animation in the same way, it doesn't start with a slide ...
1
vote
5answers
12k views

Excel VBA - adding an element to the end of an array

I would like to add a value to the end of a VBA array. How can I do this? I was not able to find a simple example online. Here's some pseudocode showing what I would like to be able to do. Public ...
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
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 ...