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].
44
questions
0
votes
0
answers
5
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
11
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
19
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
27
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
27
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
25
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
22
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
56
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
22
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
18
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
14
views
How to save data from SAP in Excel file with VBA code
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
20
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....
1
vote
1
answer
11
views
Multiple filter between date and category on a subform in MS access >> Type mismatch error
Please, anyone suggest me to solve this error, I'm new for the MS Access development. I have been getting a problem to filter subform between filter date and category. It show an error statement that &...
0
votes
0
answers
20
views
Compile Error when opening an Excel spreadsheet from Access
I have various routines within an Access database system that open Excel, open a workbook, make changes before saving it, closing it and quitting. Basically, I use this code:
Dim objExcel As Excel....
0
votes
2
answers
28
views
Progress bar in vba
I'm working with a macro that takes a long time to execute (>1 min) and I want to improve it by adding a progressbar.
I've followed multiple tutorials that all say to create a userform, add an ...