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,244
questions
0
votes
1
answer
17
views
Preventing Excel Ribbon CustomUI IRibbonUI variable from 'losing state'
We have a custom UI with two added ribbons in our Workspace Environment. This CustomUI has an OnLoad event that loads the Ribbon's pointer variable into memory for access later. Unfortunately, there ...
0
votes
0
answers
18
views
VBA to determine remote desktop user
I would like to use VBA (64bit) to determine if a user is running VBA/Excel from a remote computer. For example, if PC#1 uses Chrome Remote Desktop (CRD) to remote login to PC#2, the VBA code on PC#2 ...
0
votes
0
answers
8
views
Adjusting an Elbow in Publisher using VBA
To whom it may concern:
I am working on a Macro in Publisher that adds an Elbow connector.
I’ve got everything working except for one thing-
After creating the Elbow, I needed to adjust the position ...
0
votes
0
answers
17
views
MSAccess - TransferDatabase command not transferring data
I am trying to transfer the data and table structure from one database to another.
My database kept bloating so I moved my linked tables to a separate database and I'm attempting to pull them into a ...
0
votes
0
answers
14
views
Accessing a sheet from a different workbook [duplicate]
I have 2 workbooks, one hidden and one the user can see.
The hidden workbook contains all the code (including the line below)
Note: codeName is the code name of a sheet in the active (non-hidden) ...
0
votes
0
answers
27
views
Average of Conditionally Formatted cells by color
I have a dataset (below) in excel that is conditionally formatted using the excel pre-set GREEN-YELLOW-RED color scale. What I want to do is find the average based by color of cell...and the whole ...
0
votes
1
answer
42
views
Passing an array of objects from C# to VBA Excel
I have a C# console application and Dll. I registered the dll as COM via interop. I used the
COM Visible property, GUID etc
Set Assembly Information, Build information to register it to COM
I ...
0
votes
2
answers
31
views
VBA Hlookup multiple rows
I'am trying to use HLookup with vba, but when i try the vba code i can't apply it to multiple rows, it can only be used for single rows "J2", i need HLookup vba code for many rows "J2&...
0
votes
0
answers
30
views
VBA Different cells accourding to the ComboBox Value
tPrivate Sub CSave_Click()
On Error GoTo ErrorHandler
' Variable Definition
Dim lr1 As Long, lr2 As Long, lr3 As Long, lr4 As Long, lr5 As Long, lr6 As Long
' Last Row ...
0
votes
1
answer
27
views
Excel VBA skip empty cells
I have a code to select a specified range and paste it into an e-mail. I would like it to skip copying blank cells within the range and paste only the cells that contain data. The specified range ...
0
votes
0
answers
62
views
Copy File Names to Destination File
Hope all good with everyone.
I am trying to copy/paste file name to my destination workbook's column A. Below is copying data from all workbooks from a folder and pastes them to my masterfile.
...
0
votes
0
answers
24
views
DoEvents whilst a Time Delay Macro is running
I have a Macro in an excel sheet that selects a value in a slicer, I had a pivot which was converted to OLAP. When selecting a value in the slicer there is a short period of time where all the cells ...
0
votes
1
answer
21
views
Sending Multiple Attachments to an E-Mail from Access vba
I have the following line of code that will attach an 'attachment' to an e-mail that is being automatically created:
objMail.Attachments.Add AttachmentText
AttachmentText is a string variable with ...
-1
votes
0
answers
18
views
How to save data from SAP in Excel file with VBA code [closed]
Could you please help me with a VBA macro command to save the content of a generated report to my computer with a specified name? Thank you!
This is what I have until now:
Sub RunSAPScript()
'...
0
votes
0
answers
22
views
Export Excel table to ppt
I am editing a macro to export the selected table into a ppt slide. However, I am struggling with the code (it makes my laptop app crashes) and I was wondering if anyone had a better way of proceeding....