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

How do I insert thousands-separators without affecting significant figures in Excel?

I need to figure out how to add thousands separators to large spreadsheets without affecting the amount of significant figures or the dates that are also in the tables. I can't figure out how to use ...
1
vote
1answer
40 views

Excel VBA code and Outlook Programmatic Access warning

Since about last Friday one of my Excel macros that generates an email has been getting this warning: Microsoft Outlook: A program is trying to access e-mail address information stored in Outlook. If ...
0
votes
1answer
32 views

Automating number of paid sick days employee has remaining

I have a file showing how many paid sick days an employee has remaining, we get five days each on a rolling 365 day basis. So if someone is sick 24/05/16, 25/05/16, 26/05/16, 27/05/16, 28/05/16, they'...
2
votes
1answer
12 views

Delete graphic in Excel with VBA

In some of my worksheets I see pictures and Excel show me the names like "Grafik 4". Now I want to delet them automatically. I have 200 Excel files, always with the same picture and the same picture ...
0
votes
1answer
55 views

Copy background color from one cell to cell in separate sheet using ms-excel?

I want to copy background color for example sheetA cell A1 to sheet B A1. The cell A1 is using conditional formatting, I can copy simple but not with conditional formatting enabled. Here is the code ...
0
votes
0answers
23 views

Use VBA to set printing settings for multiple workbooks

I have more than a hundred workbooks within a certain folder and I need to set the printing format as "Landscape" & "Fit all columns on one page" for all of these workbooks. Is there a Macro that ...
0
votes
3answers
40 views

How to change the font of a specific formula which is part of an Excel Cell?

="InterContinental Vienna @ "&M9&" "&M42&" p/room p/night" based on the above example, M9 = EUR and M42 = 150 Result I am looking for is: InterContinental Vienna @EUR 150p/room p/...
0
votes
1answer
21 views

Access MsgBox for automated email

I have an Access DB set up with VBA code for a yes/no command button to send an automated Outlook email. If user selects Yes, it opens the email to allow for attachments. My problem is that when the ...
0
votes
1answer
21 views

Updating link paths with Word VBA

I have the following links to Excel in a word document: The issue is that when changes are made the document version on both the excel sheet referenced and the word document change. As such I will ...
0
votes
1answer
89 views

Excel VBA: Loop to Fill in Sequence Numbers in a Column

I am new to Excel VBA and I am currently working with a project that needs to autofill sequence numbers in Column A depending on the filled range in Column B. With the code below that I found in ...
-1
votes
0answers
23 views

Extract Data from Sql and display the results to excel sheet

I am trying to execute this code, but it does nothing and shows no errors too. Basically, I am trying to extract specific information from sql table and display the results in excel. I have a button ...
0
votes
1answer
24 views

Send bulk mail using Excel VBA

Was working on a project which will be sending bulk mail to different people if the conditions are met. Conditions : Column U contains the final status (Open or WIP) (will not send if Closed no ...
1
vote
1answer
21 views

Move between sheets every 10 sec, and bring data every 20 min in one code

I need a script that switches between sheets every 10 seconds, and then runs some code every 20 min that brings some data using copy-paste function, and then loop until I press "Esc". This is my code ...
0
votes
0answers
23 views

having to keep track of previous day on a qry and data mart update that updates daily in excel

I am currently the "numbers guy" on my team. I have been able to add multiple query data onto one sheet keeping track of multiple parts of my teams stats. I was trying to do something that keeps ...
0
votes
0answers
23 views

Apply formula to cells with data

Is it possible to apply a formula to cells with data without using macros? For example, user enters "A3 A6 A8" in a cell, and then it applies UDF "CONCATENATEREF()" to that cell that gets those ...
1
vote
1answer
39 views

Splitting one Row with Multiple Columns into Multiple Rows

So I picked up this VBA code ... Sub NewLayout() For i = 2 To Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row For j = 0 To 2 If Cells(i, 3 + j) <> vbNullString Then ...
3
votes
2answers
78 views

Excel & VBA - Where is underlying code for functions?

I was wondering if there's anywhere in Excel, or online, that I can use to see how the Functions in Excel are working. The idea is that I'm starting to learn how to make UDFs, and do various things ...
0
votes
1answer
17 views

Word Macros missing from a word doc in the network drive

I had lot of macros/VBA scripts for processing comments, merging etc in one few he word doc(word 2013)files on shared drive. i changed my computer and now i don't see any of the macros in those ...
0
votes
2answers
59 views

Protect content of certain cells without protecting worksheet

We have a excel 2016 workbook with multiple tabs, each tab is dedicated to a specific sales person. Each salespeep, logins from a form, and his (only his) worksheet is unlocked and allow for editing. ...
1
vote
1answer
87 views

Macro to loop through a web query - keeps bombing

I have built a macro intended to loop through stock tickers and in a column and use a web query to pull data on those stock tickers from yahoo finance It runs fine for 10,15,20 web queries but ...
1
vote
1answer
29 views

Show Form from cell click, then CommandButton to pass to next ActiveCell

I'm creating an input form for use with a 'tablet' PC in Excel for our guys to fill out when in the field. As inputs like drop-down menus and the like are quite fiddly, I wish to use a basic input ...
0
votes
3answers
83 views

Excel VBA - code to skip lines / goto command

I have built a code into excel to take the data from a pivot table and insert it into a chart, a pivot chart directly linked to the table wont give me the manueverability I am looking for. The reason ...
0
votes
1answer
62 views

Delete multiple rows according to a pattern

I'm working with an Excel sheet of 256,923 cells data and I need to delete 29 cells after each single cell. If I would do it manually, it would take me hours. So, is there anything I can do to reduce ...
0
votes
0answers
20 views

Word Template for Automatic Object Placement?

I have a series of data "objects" that are typically used to prepare reports. One class of objects are MS Excel tables. The second set are graphs from a stand alone app (GraphPad Prism) - these can be ...
0
votes
1answer
11 views

How to convert tabs to indents in Microsoft Word

When copy pasting text from another editor to microsoft word, paragraphs come with tabs in the beginning. How to convert those to paragraph indents, to get better formatting?
-1
votes
1answer
70 views

Best way to prevent running malicious/virus macro on PC

I've got a question. Could You provide some hints/solutions about preventing running suspicious macro's in Office apps? What I've already know: there is a possibility to turn off all macro's without ...
0
votes
1answer
35 views

Excel 2010: Blank pasted cells require activation causing formula issues

I'm having a problem copy/pasting from one Excel file to another. I have a workbook with forms for entering data. Recently, I added a sub to auto-capitalize the entry cells. Private Sub ...
0
votes
1answer
21 views

VBA coding for Outlook

Does anyone know if the vba code that is produced in Outlook 2016 is backwards compatible with 2010. I use 2007 at home & 2010 at work. I wrote a program in 07 and needed a lot of head scratching ...
-1
votes
1answer
49 views

How to change the fill color of a shape using an excel 2013 button in vba?

I'm trying to develop an excel version of a baseball scorecard with diamonds representing first through third base and a pentagon for home plate. Currently I'm working with just the first players ...
0
votes
1answer
37 views

Get distinct count based on different parameters

I need to get the distinct count (how many times does a unique value occur) based on a few parameters. The table looks similar to this: Getting the Amount is not a problem, I use SUMIFS() with a ...
1
vote
1answer
29 views

excel create a custom vba function?

Can anyone help me create a vba function to execute the following? In Sheet1 I have 3 columns A(product) and B(price) which are populated with 3000 items and 3rd column C(quantity) which is not ...
1
vote
0answers
31 views

Retrieve email ID instead of name

Below coding retrieves all the information from .msg files. However, when it retrieve the email ID of sender and received, it is reflecting name instead of email ID. Please assist me and advise as to ...
0
votes
3answers
84 views

By using VBA how do i compare values

VBA code Sub loopchange() 'select the blank column Dim level As String Range("AF2").Select Do 'move to A2 cell' ActiveCell.Offset(0, -31).Select 'find out which is level2 If ...
-1
votes
1answer
73 views

Division formula in excel

I have 2 column Price, % of Total Price how do I get the value of % of total price using VBA. I notice that there is no divide function for excel WorksheetFunction.Divide so how do I loop thru my ...
-1
votes
1answer
44 views

vlookup - Is it possible to use vlookup to pull specific info like this?

I am trying to pull the following from each group of Numbers - CHG000509443 05-16-2016 22:48:41 for the Requested CHG000509443 05-17-2016 13:14:35 for the Approved Note 1 - It is always the first ...
1
vote
0answers
85 views

Excel VBA: How can I run code when any check box value changes in a Userform?

How can I run code when any check box value changes in a Userform? I am attempting to use a class module but the code is acting in a strange way that I don't understand. The code will only recognize ...
1
vote
0answers
28 views

How to add data vertically while xtracting tables from web page to excel

My code Public Sub Raju() Dim alertTime As Date alertTime = Now + TimeValue("0:05:00") ' ' mymacro Macro ' Dim ws As Worksheet Set ws = Worksheets("Sheet1") ...
-1
votes
1answer
58 views

Excel Macro to add rows until today's date and update following columns accordingly [closed]

I got an excell sheet with 3 worksheets that I update like every 2-3 days manually by dropping down the date column and it automatically updates the columns based on the date. For example: Let's say ...
0
votes
2answers
41 views

Change recorded macro to affect current sheet

I have a macro that I use from time to time. It successfully deletes the columns I want it to, but it doesn't sort the columns as I want. When I debug the VBA, I see it references the original Excel ...
0
votes
1answer
10 views

Accessing macro function for all documents

I have created a macro function as: Sub updateFontCC() Dim doc As Document Set doc = ActiveDocument Dim i As Integer For i = 1 To doc.Range.Characters.Count If IsNumeric(doc.Range.Characters(...
-1
votes
1answer
54 views

Excel 2013 VBA script needed for [closed]

I have several cells that have a string of text that are partially Bold and partially NotBold. I need to delete the Bold portion of the Text in the Cells Example: lname1, fname1email1@email.com ...
4
votes
1answer
83 views

Sorting data without mixing rows

I have three sheets. First sheet renamed General: Dave Henderson 21/05/2014 Elton Rus 22/06/2014 John Smith 20/05/2015 Second sheet renamed ...
2
votes
2answers
68 views

Excel 2010 Range.FormulaArray using Range.Replace

I'm trying to automate some daily work where i use an INDEX()+MATCH() array formula to grab some data from different workbooks into one 'master' workbook. Manually this works as intended, but now I ...
1
vote
2answers
72 views

How to save specific attachment with date stamp from outlook inbox to specific folder?

Every morning I receive an email containing 3 files: "Daily MILH Checks e.xls" "Daily Unit Linked .pdf" "Daily Unit Linked.xls" That is 2x .xls and a PDF. File names never change. The email comes ...
0
votes
1answer
24 views

Deleting pictures from slides since last save

Please bear with me as I explain, hopefully succinctly, my question. I have a user form that, among other things, allows the user to insert a picture into a subset of sets in the project [i.e., slides ...
4
votes
1answer
561 views

MS Word: How to remove all tables?

I need to run text-check program on my doc (Grammarly), and I need to remove all the tables. How can I do it? I find https://www.extendoffice.com/documents/word/1208-word-remove-delete-all-tables....
0
votes
0answers
36 views

MS Word Macro to change string to Numbers in long documents?

I am as beginner as it gets with VBA and macro. I am looking to record a macro for MS Word documents that converts string to number. For example the document will have like (one thousand and four) or (...
0
votes
1answer
36 views

How to express a lone “\” in a file path in VBA?

I'm using a VBA script to save a file titled "month-day-hour-minute" inside of a folder titled "month-year" Anyways, excel doesn't like my code, ActiveWorkbook.SaveAs "C:\Users\" & Environ$(...
0
votes
1answer
27 views

Read file with multiple end-of-file flags

I have a pipe delimited file that was exported from server update. There are approximately 134 million records. I am using excel to import a small number of records (1,000 - 10,000) to explore the ...
0
votes
2answers
29 views

Quickly adding a category to a message

This may sound stupid but solving the problem would save me a lot of time. I am big on using categories (in place of folders, pretty much like labeling an email under Gmail), and more often than not I ...