Questions tagged [vba]
Visual Basic for Applications (VBA) is an event-driven, object-oriented programming language for writing macros, used for the entire Office suite as well as other applications. VBA is not equivalent to VB.NET, or VBS; if you're working in Visual Studio use [vb.net]. If your question is specifically about programming any MS Office application, also use the appropriate tag: [excel], [ms-access], [ms-word], [outlook], [visio], or [ms-project].
215,134
questions
0
votes
0
answers
6
views
VBA in excel stops executing automatically when sheets are switched
I created a simple countdown timer in Excel
and below is the code
//////////////////////////////////
Public interval As Date
Sub timer()
interval = Now + TimeValue("00:00:01")
If Range(&...
0
votes
0
answers
4
views
VBA Wait to confirm logging in the web page
I wrote a code to direct a user to a login web page and now want to identify if he/she logged in successfully just by page's own login form after clicking "Enter" button, then when a new ...
0
votes
2
answers
38
views
How to count the number of cells in a range that has been named with the Dim statement in VBA [duplicate]
I am trying to figure out how to use things like .count with a range that I have stored as a variable in VBA
I have made the following function which works
Function test2() As Variant
test2 = ...
0
votes
0
answers
21
views
Display photos using one drive or hard drive without prompting grant file access in Excel on a Mac
I need your support to fix this code so that it doesn't prompt for file access permissions in Excel for Mac.
The code works fine when the path directory is within my laptop's local storage in the ...
0
votes
1
answer
20
views
How can I ensure that bookmarklets made on bullet points don't overlap when we update them?
I have a doc with a lot of bookmarks that I need to update automatically via VBA Excel, so I have bullets point that go with bookmarks, as below.
- Fixe_2
- Fixe_3:
o Fixe_4
o Fixe_5
But ...
0
votes
1
answer
27
views
I want copy the paragraph that a comment has been added to in Word and put into an Excel table
i found a really simple macro in LinkedIn, from 'Harriet. L', to look at the Comments in a Word document and create an Excel table sowing the 'page, author, comment text & date created' for each ...
0
votes
0
answers
14
views
Copy range and format from excel and paste into new word doc
I need to have a button with a macro that copies a range of cells and their formatting/make it autofit width wise on an doc and pasted them into a new word document when the button is clicked.
This is ...
-1
votes
2
answers
73
views
How to select multiple cells in VBA if there is a blank in between?
If I can dynamically (without hardcoded cell range) come to the yellow marked cell "", how can I select the range like in the screenshot dynamically? xlDown brings me only to the row before ...
0
votes
0
answers
23
views
MS Excel 2016 ActiveX Toolbox
Good morning experts.
Our company creates macro enabled spreadsheet tools using VBA and controls from the ActiveX toolbox. There are some developers who use shapes vs. command buttons to trigger subs ...
0
votes
0
answers
21
views
How to create notifying icon on process boxes in VBA on Visio?
I'm new to VBA with some previous coding experience. I'm doing a job task with Visio (yay).
Is it possible to mimic something like these icons (dark blue ones in 1st pic) in Visio? I'd need to ...
0
votes
6
answers
55
views
VBA Auto Numbering
I am looking for a vba code that can autofill the number in "C4:ALN4" when "C5:ALN5" is filled with a text or value. Before that I used a formula =IF(C5<>"",COUNTA($...
0
votes
1
answer
33
views
How to reference a cell in Formula if I can find the adjacent cell?
I am trying to reference a cell in a formula using RC[-x] to get some value. The problem is that the x will be changing, because it is a growing file overtime, so columns will be added always.
I can ...
0
votes
0
answers
27
views
VBA Run time error: Document Not saved [-2147024773(8007007b)] [duplicate]
I'm a total newbie to the programming scene and managed to do small VBA Macro to convert XL payslips in to PDFs. I have created 03 identical VBA modules within the same work sheet to get the above ...
0
votes
4
answers
51
views
Need to combine two separate "Private Sub Worksheet_Change(ByVal Target As Range)"
I have two separate "Private Sub Worksheet_Change(ByVal Target As Range)" that I'm trying to make work on one worksheet in Excel. I know you can't have two worksheet change events so I'm ...
-1
votes
1
answer
38
views
VBA macro to set password to pdf files [closed]
I am trying to create multiple documents from word mail merge. Want to save them as both .docx as well as .pdf with password to open the file.
While I could successfully create word documents with ...