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
0answers
8 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
8 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
36 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
25 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
22 views

Macro to Copy Hyperlink from Another Sheet [on hold]

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
votes
0answers
18 views

Convert macro to save as Excel file and not PDF [on hold]

Sub SaveAsPDF() Dim fName As String Dim StartRow As Integer Dim EndRow As Integer Dim a As Integer With ActiveSheet fName = .Range("AA17").Value & ".RG116.150420." ...
0
votes
2answers
26 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 ...
0
votes
0answers
18 views

Most efficient function(s) to compare and extract rows from two reports? [on hold]

I work for an international shipping company processing hundreds of containers each day. I generate a report (from an AS 11g servlet, FWIW) in the morning, work through it based on the 2 Modes of ...
2
votes
1answer
45 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 ...
-1
votes
0answers
24 views

msgbox doesn't display current value [closed]

I am wondering why don't the msgbox display a new appended value from a cell rather just the declared variable. I've declared a variable called "Newentry".I am adding a string value to a cell & ...
2
votes
0answers
32 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
27 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
21 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
42 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
24 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
41 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
20 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
26 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 = ...
-3
votes
0answers
30 views

Need A VBA Code To Pull Data from Multiple excel files in to one [closed]

Sub Beachson() Dim z As Long, e As Long, d As Long, G As Long, h As Long Dim f As String d = 2 Cells(1, 1) = "=cell(""filename"")" Cells(1, 2) = "=left(A1,find(""["",A1)-1)" Cells(2, 1).Select ...
-1
votes
0answers
20 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
22 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
39 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
76 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
44 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
15 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
49 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
89 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
33 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
19 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
24 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
39 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. ...
0
votes
1answer
60 views

when criteria does not match do nothing excel vba macro

I am implementing a macro that checks column E for dates that are 7 days away from current date. If cell date - current date = 7 then an email containing the row that has the matching cell, is sent ...
-2
votes
1answer
29 views

I am trying to insert a function in my VBA code to only fill a cell when another cell has data in it [duplicate]

This is my code. It fills the Date when I have this =Updating_Date(B5) typed in C5. What it is supposed to do is fill the Date ONLY when data is present in B5, and remove the Date when No data is ...
0
votes
1answer
47 views

How to lookup a value and return multiple unique values (remove duplicates) to a single cell - comma separated

I am trying to take a value (unique id) from column AC, do a lookup in column (B) and return (meaning concatenate) the multiple unique values from an adjacent column (C) to a single cell in column AD. ...
0
votes
1answer
65 views

Excel VBA: Is there a command for printing to PDF (doPDF ver 7)

As the title suggests... I'm looking to expand my automating to include directly printing to PDF. The macro(s) I have written already formats the print area and page setup as I need it. But when I go ...
0
votes
1answer
49 views

Access 2013:Trying to write macro to update form fields from a query result

I am trying to create a macro to update the value of a field in a form based off the results of a query. I am entirely new to working with vba in Access so I apologize if I am asking a basic ...
0
votes
1answer
39 views

Trying to highlight unique values across multiple sheets in Excel 2007

I am trying to compare the values from column A of Sheet1 (which I have renamed "AR") and column A of Sheet2 (which I have renamed "Paste Here") and highlight rows containing values that do not exist ...
0
votes
3answers
88 views

How to find a number after a character in VBA

How can I find a numeric value after a character in the same cell. For example: Find number 01 after J*. I have a few rows and in each row are value like J*01 or J*08. Currently I'm trying to ...
0
votes
1answer
23 views

Excel VBA embedded FOR Loop to exclude cells from the outer conditional

Starting with the following code: Dim lastRow As Long With ActiveSheet lastRow = .Range("C" & .Rows.Count).End(xlUp).Row End With Dim HeadCell As Range For Each HeadCell In ...