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

Executing SQL Stored Procedure through Excel (VBA) with multiple parameters

I am a newbie when it comes to VBA and so I am struggling to get my query to run with more than one parameter. I am using this macro as but when I run it it tells me the second parameter has not been ...
1
vote
0answers
22 views

Combining INDIRECT() and UDF

I have created an Excel UDF to find the nth occurrence of a value in a range. The UDF is based on the one at http://www.ozgrid.com/Excel/find-nth.htm: Function Nth_Occurrence(range_look As Range, ...
0
votes
2answers
48 views

Excel - Manipulating data in awkward format

I have a dataset that I want to analyse, but it is in quite a strange format. See below: > Account_Details Account_Name > account # 1 client name > product 1 name ...
0
votes
0answers
6 views

Macro to reference tagged objects on other slides

I am wondering if there is a macro that could automatically update slide references for objects on other slides. For instance, let’s say there is a table on slide 20. I want to be able to place a text ...
0
votes
1answer
15 views

I have an Excel file with a worksheet that is completely white and on interactive. It's also not protected. How do I acces it?

I am working on a rather complex Excel file that has various Database connections and VBA code behind it. This file is getting pretty old and has had many people work on it during its life. There is ...
0
votes
0answers
18 views

Excel 2010 Macro throws Object or Method Not Supported error

I keep getting an error 438: Object doesn't support this property or method when trying to run a portion of a macro I have that updates three PivotCharts off of the top three items on another table. ...
1
vote
1answer
62 views

Excel VBA row fetching loop

I have three sheets: "bom", "MPS" and "DData". What I'm trying to do is first read the value of cell A2 from "MPS" and fetch all the rows from "bom" that in column A have that value and list them to ...
0
votes
0answers
22 views

Word (Office 365) macros disappear

I have created a few simple macros in Word. One of them allows me to switch between printers without multiple clicks. I create this macro (and other simple ones) and they work. The next day, the ...
0
votes
2answers
31 views

Merge two Excel files and only retain new data?

I manage a daily shipping report (an Excel file) that has many date fields (departure, arrival, etc.) that are populated automatically from our shipping system. In the last column of the report I add ...
0
votes
3answers
53 views

calculating end times with working hours and skipping weekends

In my worksheet, I want to calculate estimated end times of processes. However, i want to restrict this to a predetermined time constraint. So for example, when i add 4 hours to 14:00 I dont want the ...
0
votes
1answer
25 views

VBA highlighting a cell if corresponding range in the same row is not blank

I am trying to enforce food name in column B of a file if column D to DX (Qty) has any value in it. Rational is if any new request of food is received which doesnt appear in the file, the user can ...
-1
votes
0answers
19 views

Replace cell references with values without F9 using macro (2) [duplicate]

I tried to use the macro in this post but it doesn't work on mine. Can you help to tweak this macro abit? I want to change from this: =((J26*J27*J28+J34*J35*J36+J30*J31*J32)*24/1000000) ... to ...
1
vote
1answer
33 views

Excel add-in not loading when opening Excel from VBA

I'm using excel reg-ex add-in and it works well, the only problem with it that it doesn't load when excel is started by VBA. I've a macro in word to collect some data in Word and copy it to excel, ...
1
vote
2answers
80 views

How to split numbers into separate digits in Excel

Does anyone know a fairly simple way to split numbers of various length into separate digits and then manipulate each digit? Could probably do it in Excel itself, but thinking a macro would be nicer ...
0
votes
3answers
39 views

Compare two sheets in Excel and extract the differences to other third sheet

My situation: I got a huge excel sheet from a manufacturer of products for my online shop. This format: product ID | price | name | ... Every week the manufacturer is sending me a updated list ...
2
votes
1answer
58 views

Excel Macro Hyperlink.Add Errors

I'm relatively new to VBA code within Excel, so please forgive me if the answer is simple (I expect it usually is). I'm using Excel 2010, for reference. I'm trying to accomplish the following, with ...
1
vote
1answer
44 views

Updating Microsoft Word link item through VBA

Is it possible to change the Item of a link in MS Word referencing to an Excel spreadsheet, pragmatically, through the use of VBA? I have found discussions on how about to change the file source, but ...
0
votes
0answers
27 views

Use VBA to reset style inheritance (Word 2013)

I would like to revisit this question - Remove setting from style to inherit setting from base style - since the answer provided and voted doesn't really do what I want it to do. A style in Word can ...
2
votes
1answer
36 views

Delete the digital signature from a received Outlook message

My goal is to delete the digital signature in an Outlook message. My initial idea was to create a VBA script (which I have done below) to enumerate all attachments in the selected mail item and ...
0
votes
1answer
48 views

Excel VBA that loops through the folder and move data to the next column

I am trying to write a macro that loops through all of the files in a folder m then opens it and looks for the words starting with "Page" in K column and then shifts it to the next column. The code I ...
0
votes
1answer
25 views

VBA to prevent the global shortcut from running the wrong code

The article at the following site provides a tip for preventing a global keyboard shortcut from executing the wrong VBA code when two different macros in two different worksheets are assigned the same ...
1
vote
1answer
35 views

macro for arranging data into a column

I have List of files with product price data in it, I converted pdf files to xlsx format while converting data is dislocated, the price data is dispersed in J,K,L columns, is there a macro in excel ...
0
votes
3answers
79 views

Excel Macro insert value into another cell

Okay I'm needing some help with excel i'm new to it. I have a spreadsheet that adds all these value together and puts them in cell M3. However this is a daily spreadsheet I will be using so I want to ...
0
votes
0answers
26 views

How to clear just the data from multiple Excel spreadsheets after copying using VBA

I am brand new to VBA and I have some code to transfer data from multiple spreadsheets into one master spread sheet. This works ok but at the end I need to clear the days data from each of the ...
0
votes
0answers
19 views

Combining all combinations of data from mutiple columns in Excel

I am looking at this code Mr. Fedorov provided on November 5, 2014: Combining all combinations of data from three columns in excel It is doing what I expect it to do, but my range appears to be too ...
-2
votes
1answer
26 views

VBA Find and Replace Syntax Error

I have a find and replace for some html tags and also replacing pipes with break characters. I need to replace pipe with Chr13 and then replace Chr13 with Chr10 as a subsequent step - below is the VBA ...
0
votes
0answers
28 views

VBA: Restrict copy paste in drop down on PROTECTED Sheet (Figured out unprotected sheet but doesn't work for protected)

I am looking for a code that will allow me to restrict copy pasting something in a drop down menu. After some searching and trial and error I have found something that works perfectly on an ...
0
votes
0answers
39 views

Word VBA: impossible to remove/reset formatting from a character style?

I am puzzled at how I can remove e.g. bold and italic formatting from a character style in Word (2010). That is, I want to clean/reset the character style, rather than saying if something should be ...
-1
votes
1answer
32 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
17 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
36 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
27 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
vote
1answer
78 views

Outlook-VBA 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
26 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
36 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
18 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 ...
2
votes
0answers
26 views

How to enable macros on an external hard-drive

I have an external hard-drive that I have mapped locally to the e:\ drive. There is a subfolder that contains Excel sheets with macros that I am unable to run. In File->Options->Trust ...
1
vote
2answers
60 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
30 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
9 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
25 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
15 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
113 views

Creating folders and subfolders from Excel cell values

I'm trying to create a directory named as 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
35 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
42 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
62 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
54 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
73 views

Append values to Access table from Excel with ID autogenerated

I have an Access database with some tables which get updated daily with some values. I need the tables to have an ID field which is auto-generated 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
42 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 ...