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

Whenever I drag emails, it will automatically forwarded to email address and move to a folder

Do you have an Outlook script on this process? I have 3 sub folders under inbox, A_Type Email folder, B_Type Email folder and Forwarded Emails folder. Whenever I drag emails to either A_Type Email ...
0
votes
0answers
16 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
18 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 ...
3
votes
1answer
14k views

How to bypass the VBA project password from Excel

I need help with password retrieval or bypassing the password on a project that was done at work. The author has used MS Excel to do the project, and it's in the client's server. The server that we ...
-1
votes
1answer
17 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
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 ...
0
votes
0answers
11 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
11 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
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
0answers
10 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
3answers
26 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
0answers
17 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
2answers
28k views

VBA code to hide or unhide rows based on a cell value

Heres my code, but its not really doing anything, I dont see anything wrong with it: Private Sub PG1(ByVal Target As Range) If .Range("E50").Value = "Passed" Then ...
0
votes
1answer
44 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
29 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
2answers
2k views

How to inspect / view an Excel macro before “enabling macros” for a sheet?

I'm receiving occasionally an xls file that contains a macro which I should use. If I don't have complete trust in the sender, I wish to look at the macro's source in order to verify that it indeed ...
0
votes
1answer
21 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
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
34 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
3answers
80 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
37 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. ...
-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
3k 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
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 ...
0
votes
1answer
27 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
0answers
23 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 ...
0
votes
1answer
39 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 ...
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
33 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
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
1answer
975 views

Merging rows in an Excel document with the same email and preserving merged row data

I have an excel sheet of around 50,000 records of something like this: email product info moreinfo a@a.com 866 data data1 b@b.com 960 data data1 c@c.com 976 data data1 c@c.com ...
0
votes
1answer
8k 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
2k 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 ...
0
votes
1answer
39 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
38 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
0answers
38 views

I need a macro to separate a column of names into 4 different shifts

Our system creates a report for accuracy. Our manager wants it separated by shifts. From those lists, it will go to a report 'by shift' along with the information on the row with each. I need a macro ...
0
votes
0answers
67 views

Change Excel cell value on each saved revision

Is there a way of increasing cell values on each file save? I have a version number on a macro-enabled spreadsheet, and I want it to increase by say 0.1 each time I save the file. I would rather not ...
0
votes
1answer
74 views

Macro to manage sport ranking and calendar?

I need to write a macro (or a different easy way) to manage ranking and calendar for a curling tournament. The event will follow the Shenkel system: first match determined by general draw after ...
1
vote
0answers
3k 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 ...
0
votes
1answer
281 views

How to convert data in table format to pivot format

I would need help in converting table which is in table format to a pivot format. Below is the sample data which I have: Product Currency Value US UK Japan Ind Local MNC Product 1 ...
0
votes
0answers
195 views

I'm looking to create some VBA code to search for other instances of certain string, move original instance above found

I'm looking to create a fairly basic VBA macro to automate a process in excel. I'll otherwise have to manually repeat hundreds of times. I have a sheet with several hundred rows of data, with about 20 ...
0
votes
0answers
96 views

Reformat a text file using a macro in Excel

I need to reformat a report I receive every month as a text file so I can perform spend analysis on the data in Excel. The report was in a statement format before converted to a text file because the ...
1
vote
1answer
438 views

Microsoft Excel Ceiling function

I've got a lot of data that I'm trying to enter into an excel spreadsheet. All the data in columns after the first are of the form: Previous column data * 1.3 {rounded up to the nearest ...
0
votes
1answer
19 views

Excel leaving formula when selecting another sheet

I am attempting to reference a range in another workbook in a vlookup. I type =vlookup(a1, and then go to the other workbook to select the range, but alas, I am no longer in the vlookup formula. I ...
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.
0
votes
1answer
4k views

How to merge multiple sheets of Excel files to one Excel file?

I need to merge hundred Excel files into one Excel file. Each Excel file needs to be merged into its own worksheet in the workbook and the destination worksheet needs to have the name of the original ...
0
votes
2answers
4k views

Macro to open excel hyperlinks

I would like to know if anyone can help me do a macro to open a list of hyper links. I have a list of about 600 hyper links all in a column in separate rows, I have to open each one to see if the ...
2
votes
1answer
2k views

How to revoke a macro in Excel?

After the execution of a macro in Excel, there's no button to revoke it, unless you close the book and choose not to save it. Is there a neat and easy way to just revoke it?