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
0answers
3 views

Most efficient function(s) to compare and extract rows from two reports?

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
0answers
26 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
20 views

msgbox doesn't display current value [on hold]

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
18 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
21 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
17 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
39 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
22 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
37 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 ...
-3
votes
0answers
11 views

vba code for display a “Current Slide Layout Name” and “Current Slide Used Font” in powerpoint status bar [closed]

Need VBA Code I Want to display two information in powerpoint 2013 "STATUS BAR" (Bottom of the screen) Current Slide Layout Name view-> Slide Master and Move your Mouse cursor to get "current ...
1
vote
1answer
19 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 ...
-1
votes
0answers
12 views

VBA modify formula to last cell in column A [on hold]

How do I change the reference A2 to a dynamic reference, such that it always refers to the last non-blank cell in column A? ws.Range("A2:A" & lastRow).Formula = "=datewanted" For reference, ...
0
votes
1answer
24 views

How to declare variables to be used in many projects with VBA Excel? [closed]

I can't fix this. Public BS As Integer, AVG As Integer, STD As Integer, NORM As Integer, SKW As Integer, K As Integer, BA As Integer BS = 95 AVG = Application.Average(Range(Cells(R + 1, KOL), ...
0
votes
1answer
24 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
25 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
19 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
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
35 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
70 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
35 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
13 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
15 views

Control MS word add-ons using recorded/programmed macros

I have installed a Microsoft word add-on (not specified because this problem is likely common to many add-ons out there) and I want to add some specific functionality to it. I could be wrong but I ...
0
votes
0answers
19 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
43 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
77 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
31 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
34 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
18 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
21 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
31 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. ...
-1
votes
0answers
30 views

How do I stop excel duplicating values in VBA?

I run a code that groups same products together and total quantities of those products. However It only works if all items are filled in if not it duplicates. For example: Instead of Product 1 ...
0
votes
1answer
53 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
27 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
43 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
59 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
42 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
86 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
20 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 ...
-1
votes
1answer
19 views

Macro to open word through excel

Sub test() Set myWorkbook = Application.Workbooks.Open(Filename:=[B1]) On Error Resume Next myWorkbook.Sheets(Cstr([D1])).Activate On Error GoTo 0 End Sub How the above macro works : ...
0
votes
1answer
63 views

Excel VBA: How to find last row of a worksheet containing actual data

I know how to find the last row of my worksheet that has any type of data or values Dim lastRow As Integer With ActiveSheet lastRow = .Range("B" & .Rows.Count).End(xlUp).Row End With ...
0
votes
1answer
32 views

Pass Parameters from vba to vbs

I'm trying to pass arugements to my vbscript from vba. Shell "wscript C:\test.vbs " & strName & fileDir But in the vbs its taking it as one arguement. How to pass two different ...
0
votes
0answers
27 views

How to show all the worksheets on user form in vba?

I used my code to open up workbook, after I select the workbook, I want to prompt user form which will display all the worksheets which belong to the workbook. Here is my code: Function ...