Skip to main content
The 2024 Developer Survey results are live! See the results

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].

0 votes
0 answers
8 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) ...
jsgv's user avatar
  • 21
0 votes
0 answers
15 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 ...
em4019's user avatar
  • 43
0 votes
0 answers
19 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 ...
Dee's user avatar
  • 1
0 votes
1 answer
22 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&...
Caya's user avatar
  • 13
0 votes
0 answers
23 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 ...
Onur's user avatar
  • 1
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 ...
kyle245's user avatar
0 votes
0 answers
52 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. ...
metalscuba's user avatar
0 votes
0 answers
21 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 ...
MBrann's user avatar
  • 235
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 ...
Ian Bateman's user avatar
-1 votes
0 answers
13 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() '...
Dinita Mircea's user avatar
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....
Kede51's user avatar
  • 1
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 &...
Ployphet Veerasak's user avatar
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....
Ian Bateman's user avatar
0 votes
2 answers
27 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 ...
Brocas Sylvain's user avatar
-1 votes
2 answers
21 views

Excel VBA - Loop through row and copy paste to another sheet if condition meet

I have 2 sheets - "Current" and "Email". I want to have a script that reads that row by row on Column A - D. If Column D = "", then Copy corresponding Column B value ...
Raymond's user avatar
  • 25

15 30 50 per page
1
2 3 4 5
9