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
1answer
18 views

Hide user form on non active workbook?

I have a user form that when a workbook is opened, will show a user form with command buttons. I want to be able to open another workbook and not see that userform on the other workbook. I only want ...
1
vote
3answers
72 views

Excel - How to return the first number only string that is between 7-10 characters long in a large body of text? (preferably Formulas only)

I'm trying to extract some numbers from a few cells that each have a large body of text. The number strings are accompanied by certain words that precede the number string I'm trying to extract. ...
1
vote
3answers
78 views

How to combine values from multiple rows into a single row? Have a module, but need the variables explaining

I'm completely new to VBA and trying to implement the excellent looking solution here by Raystafarian How to combine values from multiple rows into a single row in Excel? (the revisited version). ...
0
votes
1answer
31 views

Keep command button visible while scrolling down worksheet?

Is there anyway to keep a command button visible and while you are scolling down a long worksheet, you can still see the button scroll with your worksheet? I know there is the freeze pane but I would ...
0
votes
0answers
41 views

How do I make form fill out to different sheets based on the month?

I have an exercise and diet log that I fill out every other day and I want the data to move to another sheet. Sheet 1 looks like a worksheet and I want it to move (I think the best way to do this is ...
-2
votes
0answers
42 views

Excel 2010 and VBA

I'm having trouble setting up a VBA script to successfully run in Excel 2010 page set-up. I was hoping to automate adding a repetitive Header Title, top right page x of x, and LFooter stacked ...
-1
votes
0answers
50 views

Java Installer crashing when accessing VBA code

I work usually with DDE Excel. I have two computers, one with Windows XP and another with Windows 10 64 Bit. The problem happens with the latter computer. I connect the computer with provider DDE ...
0
votes
1answer
26 views

How do I identify partial duplicates in an excel list?

I have a list of over 1000 company names, however some are duplicated but they aren't exact duplicates (ie: Nintendo, Nintendo Inc, Nintendo Video games, etc), is there a way to identify the ...
0
votes
0answers
17 views

How do I accept tracking changes for a specific symbols and reject for the rest of the text?

I would like to accept tracked change only for specific symbols like manual line break and break section and reject any other changes. How can I proceed? I guess it should be a macros which looks for ...
0
votes
1answer
27 views

Check cell value for active conditioning format being applied?

Is there a way to check if a range of cells have a certain conditioning format on them such as cell is highlighted if blah blah blah... ?
0
votes
1answer
56 views

How to disable right click “delete” option on worksheets tab

Is there a way to disable the right click "delete" option on the excel worksheets tab at the bottom to prevent users from be able to delete a worksheet. I know that protecting the worksheet/workbook ...
3
votes
3answers
111 views

remove leading 0 in front of decimal except when a a non-zero number precedes it

I have a column, which has a comma separated values inside each cell that look like this 0.1, 0.2,0.3, 0.4,0.5, 0.8,1.0 1.5, 1.6,2.0, 10.6,10.9, 15.2,30.75 20, 0.25,280.2, 0.29,300.2, 423,530.76 ...
0
votes
1answer
27 views

How to run Sub with parameter in Excel VBA?

I have procedure in Excel VBA which is need range parameter and also will produce output range exactly in active cell. The code looks like this : Sub test(oSource as Range) Dim oTarget As Range ...
0
votes
0answers
23 views

How to autofill content controls based on a seperate dropdown list in Word?

I have a form with multiple fields. Three of these fields are dependent on the selection chosen in a dropdown list at the top of the form. For example: if Location = New York City, then the ...
0
votes
1answer
29 views

Hardwareinventory - Copy Record with values in Access 2016 Web App

I want to make a WebApp in Access which help me inventory all our Hardware. Below is a VERY wip ERM for the Database behind it. Every CPU-Object is its owm physical thing (if we have 2x i5-3450 there ...
0
votes
1answer
51 views

add space after nth commas in Excel, Notepad++, or emEditor?

Notepad++ 6.8.8 I want to be able to turn several lines that start like this: 0,2,3,45,67,89,01,234,567,890,123,4567,8901 0,7,8,9,0,11,12,13,14,151,162,173,184 x,z,q,r,n,f,t,a,e,f,z,n,a into 0, ...
0
votes
1answer
48 views

Excel If formula to vba

I have this formula which checks a cell to see if its a 6,2,a, or b, in which case the word cash is written. ...
0
votes
1answer
43 views

Formula or VBA for cell formatting using value based on a cell but formatting from an other cell

I have a fixed set of values, (0%,20%,40%,60%,80% and 100%) in column E. If I fill a cell in column E with any of the above values, the cell G should pick formatting from another cell. For example, ...
0
votes
1answer
646 views

PC unable to find EXP_PDF.DLL

I have an Excel workbook that uses VBA to create PDFs from sheets, and send them via email through Outlook. When I click the button to create the PDFs and send, Microsoft Visual Basic gives me the ...
0
votes
2answers
22 views

Custom formula for databars in Excel

How would one go about using a custom formula to determine the format conditions for databars? Meaning, in Excel under "Conditional Formatting" there's a format called "Data Bars". However, you ...
0
votes
1answer
41 views

Emails replied to by VBA script do not show reply icon with purple arrow

I have a VBA script that moves an email to a folder (dialog box) and generates a reply that will be saved in the same folder. The problem I am having is the original email never shows the reply icon ...
0
votes
1answer
86 views

Same Bookmark for Multiple Locations MS-Word

I am feeding Excel data into a Word document with Excel VBA. When doing this, I have many bookmarks in Word. Sometimes I need to pull the same value from Excel and feed it to multiple bookmarks in the ...
-1
votes
1answer
37 views

How do I solve “runtime error type 13 Type mismatch” in excel VBA when clearing contents?

I have some VBA code that clears contents from several cells. Most of those cells have data validation so that a value must be selected from a list of options (yes, no, NA), the rest are open for any ...
0
votes
0answers
13 views

Create a calculated field in Outlook to be used in views

I know how to use VBA to create a user defined field for a folder. Is there anyway I can create a user defined calculated field that is global that I can use in views? I want it global so I don't ...
0
votes
2answers
11 views

Looping through two column to check for condition

I want to loop through column P and see if there is a cell that has the number "1" in it then at the same time loop through column N to see if there is also a number "1" at same row/column, if there ...
0
votes
1answer
59 views

Check excel cell if font is a certain color?

I want to use vba to check if the text in a cell in excel is of a certain color, lets say red. Any ideas?
0
votes
0answers
29 views

Excel, worksheet scrollbar size

I have a problem with the vertical scrollbar on one of my worksheets. The worksheet contains ~20000 rows and the scrollbar is too big to use conveniently. However when I click and drag it, it ...
0
votes
2answers
41 views

Excel VBA incrementing columns

I am trying to combine multiple columns of varying lengths into 1 column on another sheet to allow for vlookups off this column. I am able to increment down through the first column easily, but I am ...
0
votes
0answers
18 views

In MS Access VBA Designer window all menus, ribbons and tootlbars are missing

The missing items make it impossible to use. Code can be written, but not executed and tested.I have tried many solutions, most of which are to restart the VBE, but that does not work. In fact, none ...
0
votes
2answers
29 views

VBA query - adapting existing code

I've found a bit of VBA which is helping me do what I want to do, which includes the following: With ThisWorkbook.Sheets(TargetSh) NxtEmptyRw = .Cells(65536, 1).End(xlUp).Row + 1 .Cells(NxtEmptyRw, ...
0
votes
1answer
28 views

#NAME? on UDF that previously worked

I created a VBA function: Function LOJA(x As String) Dim a As Integer Dim f As String Dim f2 As String Dim f3 As String a = InStr(1, x, "-") f = Right(x, Len(x) - a) a = InStr(1, f, "-") f2 = ...
0
votes
1answer
40 views

Change name box of a image inserted into excel worksheet

When you insert a picture into a excel worksheet, you get automatically Picture 1, Picture 2, and so forth...... I have a function when a picture is selected to put black border around it. Problem is, ...
0
votes
0answers
28 views

Excel 2007 Unprotect Sheet prompt in password protected sheets on Windows 7 machines

Windows 7 users of software I created in Excel get an "Unprotect Sheet" prompt when clicking on any sheet or cell in a sheet that is password protected. They hit cancel, sometimes several times and ...
1
vote
1answer
52 views

MSWORD VBA close document on save

I am trying to get a document to close when saved, using VBA. I have searched for this extensively but mostly it comes up with people trying to not turn off saving when closing a document. What I ...
0
votes
1answer
63 views

Excel trying to save as PDF using a Cell Value for both the Path and the File Name

I've been using excel to save my Worksheet as both PDF and as a .XLS separately based on a cell value, but it saves in the same folder as the parent file. I have been trying to find a way to use VBA ...
0
votes
2answers
43 views

VBA: how to hide rows if a cell contains a certain text

I am using Excel 2013. I am new to VBA. I found a code that would simply hide 2 rows (36 and 37) if my cell N39 is equal to "Passed" I found that code but I receive the message "ambiguous name ...
0
votes
1answer
35 views

Excel macro: replace entire worksheet with different values [closed]

Is it possible to replace entire worksheet with different values at the click of a button through macro? There are no "replace X with Y" or any recognizable pattern, I'm trying to replace ALL values ...
0
votes
0answers
21 views

How to hide sheets that have cell u1=x

If I want to hide tabs that have u1=x, how would I do that? I have this but it is just hiding all pages instead of just the ones that have u1=x Sub Hide_Sheets_Containing() Dim wks As Worksheet ...
0
votes
0answers
50 views

Match between two cells if values is in a range VBA

I'm struggling in VBA because I want to compare two cells in order to check if there is a partial match between them. But I want to remove the entities that are not common to both cells through list ...
0
votes
0answers
47 views

Opening Google Chrome with macro instead of IE

I have a question regarding a VB macro that opens automatically a file in IE 11. The problem is I cannot get the download prompting to disappear (believe me, I've tried everything from Tools in IE, to ...
-1
votes
1answer
40 views

How to clear print area

I am new to macros. I am trying to find a macro that will clear the print area on specified worksheets that do not have cell u1="x". My workbook has over 80 worksheets.
0
votes
2answers
15 views

How can i change the directory in this VBA code? VBA “Excel to TXT or CSV”

I really want to change the directory of this code in Application.ActiveWorkbook.Path but i don't know where to put it. Public Sub CharacterSV() Const DELIMITER As String = "|" Dim myRecord ...
1
vote
3answers
46 views

Find first string in text string that is numbers only. Formulas only

Is it possible to find the first string within a string that contains only numbers/digits? I have a few thousand addresses to process and some of them have Apartment numbers. I need to find the ...
0
votes
1answer
24 views

Underline Definitions in Index? (or keep formatting from orig. text)

I'm building an index in a word document that is going to be definitions. My index will look like: Superhero - someone who is a super being.....17 Bus - an automobile that is long, like a ...
2
votes
1answer
110 views

Excel Macro to create 8 character username

I'm trying to use an Excel VBA macro to create an eight character username and what I came up with fails. If entered in a cell, the formulas seem to work. In my spreadsheet, I have the last name in ...
1
vote
0answers
19 views

How to make text baseline and midline visible in Word?

I want to make baseline and midline (or x-height line to be precise) visible (and printable) in a line of text (presuming characters in the line are the same font and size). Is it possible to do so ...
0
votes
1answer
39 views

Hightlight cells where the IFERROR=TRUE; Not “TRUE”. Suggestions?

Example: Formula: IFERROR(H12,1) Table: I am trying to highlight every cell in the table that returns a 1 only if the IFERROR statement is TRUE (not "TRUE"), and without comparing the returned ...
0
votes
1answer
24 views

Record multiple calculation results at each change of single input cell

I have a spreadsheet that calculates reduced generation and emissions per fuel source for the state of Wisconsin at different levels of solar photovoltaic capacity in the state, as a percent of the ...
1
vote
2answers
31 views

“The object invoked has disconnected from its clients.”

I have a button that prompts for input and creates a new tab. The first run it works great, but subsequent runs throw this error: Here is the code: Sub btnAddProject() Dim template As ...
0
votes
0answers
22 views

Automatically (VBA) remove page colour when replying or forwarding email

I am looking to create a macro to remove the page colour from an email when replying to it or forwarding it, either automatically on the single click of a button, instead of having to go to the ...