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
4 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
7 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
8 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
7 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
15 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
25 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
42 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
24 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
28 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
17 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
19 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
0answers
27 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
31 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 ...
0
votes
0answers
15 views

Needing an excel macro to take me from the excel cell to the folder a specific file is in [on hold]

I am torn between a database program or an Excel macro. I want the line to have the high level data fields that I am looking for. If I want to be sent to the complete doc I just want to be sent to a ...
-2
votes
1answer
25 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
36 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
36 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
24 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
32 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
79 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
18 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
16 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
37 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
23 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
22 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 ...
1
vote
2answers
47 views

How to I simplify code that combines information and adds up values for certain columns?

I am revamping some VBA code that was done 15 years ago that someone else created. I have to add more code to fit our needs but I exceed the amount of code allowed to run. I have a Products in ...
0
votes
1answer
32 views

Visual Basic Debug in Excel

I had a workbook created for me. I made a mistake and deleted an entire row from the Master Page and now I am getting a debug error and #REF! on the UC-K sheet. The error says Run-Time Error '13': ...
0
votes
2answers
33 views

Hide rows based on the value of another cell

First, I've tried these threads, to no avail (1, 2, and others which I am prohibited to mention since my rank doesn't allow for more than two links). I am almost certain I'm just missing some simple ...
1
vote
1answer
26 views

How do I change color every time my length is bigger then 5 character in VBA

How can turn my color into green when my length exceed more then 5 characters. I keep getting "object doesn't support this property" error Sub deme() Dim lastrow As Long Dim a As ...
0
votes
1answer
38 views

How do I prompt with a msgbox VBA [closed]

How do I prompt with a msgbox in VBA, when excel rows are changing to different letters. For example if I have AAB in row1 and BBA in Row2, I need a prompt box after row1.
1
vote
2answers
63 views

How do you unprotect the VBA macros for a macro-enabled workbook if you forgot the password?

I have heard myths about how easy it is to crack a VBA macro password, but haven't been able to figure out how to do it myself. We have an excel file at work where the VBA is password protected and ...
0
votes
2answers
22 views

Ignore an empty text field

I keep getting a cast exception when running a subroutine in a userform. It recognizes the null value when it reads txtMileage.text = "" and throws an error because it's trying to determine if the ...
0
votes
1answer
46 views

Excel: How to search multiple workbooks for Cell information

Good Afternoon Currently we receive e-forms filled out with excel from our customers, so I have a folder filled with workbooks. Each workbook has multiple sheets. I need to search through each of ...
0
votes
2answers
41 views

Is it possible to have an excel workbook automatically save as macro-enabled if macro is added to the workbook?

Currently, in Excel 2010, when I try to save a workbook that I have created as a .xlsx file but added a VBA function or subroutine to, Excel gives a prompt asking (in a round-about way) if I want to ...
0
votes
1answer
32 views

Macro in Excel To Add an extra row

I am creating a Macros in Excel that adds a row and formats it. The code works okay although i need the value for "i" to be a variable (instead of 20 as shown) depending on the number of entries in ...
1
vote
1answer
29 views

Excel VBA format footer that contains calculated value

I have a macro for my footer that uses the RIGHT and LEN function to pull strings from various cells within the worksheet. I've tested on various sheets and this works. ...
0
votes
0answers
9 views

How to I auto-refresh an Excel auto-filter when data is changed … On a mac

this question is a variation on a previous question posted here How to I auto-refresh an Excel auto-filter when data is changed? I implemented this solution and it works fine. But on a mac this ...
0
votes
1answer
33 views

Excel VBA Insert Rows above Cells with specific Formatting [closed]

I am not very good in VBA but I already looked for an answer online for hours. Hope you can help me. I would like to insert rows above cells that are filled with a specific color (two different ...
0
votes
1answer
36 views

Format range that is dynamically based on other cell values

Take the following excel spreadsheet into consideration: I would like to format the cells in row1:2 according to the values in cells A4:B7. If I change the values, the cells in row1:2 should be ...
0
votes
1answer
36 views

VBA project works fine on machine with outlook 2013, but not on a machine running outlook 2010

Both machines are running 64-bit versions of Windows 7. The project has been painfully pieced together, I am not a programmer. The function of the project is to automatically search emails for ...
0
votes
2answers
19 views

Search for 'X' then replace everything in its column U with 'abcdefg'

I have a list of 7000 products in Excel ("list1"). Each can be identified by a unique identifier ("sku"). I retrieved a different list of 50-100 products from the main list ("list2"). With this ...
1
vote
2answers
38 views

Show timestamp when cell is changed

I need to know how to show a timestamp in a cell in column D when a cell changes in that same row in column B. I edited this screenshot in paint to show what I mean more easily: The image I have a ...
0
votes
1answer
20 views

Specifying “Where” in when inserting building blocks in MS word 10 via VBA

I'm trying to add a custom building block at the click of a button in MS word 10. Below is the code currently attached to my activeX button. Private Sub CommandButton1_Click() Dim objTemplate As ...
-1
votes
0answers
13 views

linking validation to pivot tables to create dashboard

Please can you advise why this scribt is not working on my excel 2007 but is working on another excel 2007 computer Private Sub Worksheet_Change(ByVal Target As Range) 'disable events and screen ...
0
votes
1answer
38 views

Macro in Excel to add the date in ISO-8601 format

For some reason, Excel forces me to use my region for footers when I insert the date. However, it also doesn't auto update when the worksheet opens. Without the formatting this is a rather trivial ...
0
votes
1answer
25 views

How to make a Custom List with sheet cross reference?

At the end of the month i get a excel file with a variable number of sheets. Every sheet has a value in the same cell: A1 I want to create a new sheet and display all the values of A1 on every sheet ...
0
votes
3answers
21 views

Quickly delete all floating picture in Excel sheet

I have a lot of photos in my Excel sheet. I want to delete them all - currently Ctrl-A just select all cells. How can I select all photo objects?
0
votes
1answer
106 views

Word VBA: How to run Selection.Find within a pre-defined range?

I have two blocks of Word VBA code here that each work fine separately, but which I need to combine in order to obtain the desired result. One identifies a range of text (oRng), while the other runs a ...
0
votes
0answers
26 views

Task Schedule excel file with ODBC/Oracle connection

I am having problem running an excel file with ODBC connection for Oracle to run via Windows-7 Task Scheduler. It will just say running. What the excle file does. After I open the file, it will ...