Category "vba"

chromedriver Selenium in vba

I am currently struggling with coding and need help from an expert. Help. There are a large number of classes ("df-table") on that link homepage. The first clas

What is the code to read the last row and last column of an excel table?

Good morning, I have this code below that send an email with an attachement (excel file) and a table in email's body. Sub Email() Dim outapplication As Object

How to find double data type in range.find

Input: Sub RangeFindWithDoubleType() Dim strResult As range With ActiveSheet.range("A2:A11") On Error Resume Next Set str

Application-defined or object-defined error when any cell in worksheet is edited

I am relatively new to VBA and have managed to edit a worksheet_change sub from example code found online (Thanks Tim Williams!) that allows multiple selection

.Body & .HTMLBody Indent and Default Signature Issue

I've set up a macro to send an e-mail through Outlook. .Body is read from a cell inside the file with indents. Since the value will change depending on the usag

VBA: Creating a class property that is an array of dictionaries

In Microsoft Excel VBA I need to create a class that has two properties, "Name" and "Holdings". "Name" is just a string so the code for that is easy. But I ne

Outlook Error: user-defined type not defined referring to Excel workbook

I get 50 mails with Excel sheets per day. I want to add the first line of each Excel sheet to an existing Excel sheet located on my computer. I first wrote a sc

Copy table from one workbook to another however does not copy columns with equations properly

I have written code in VBA which copies a dynamic table (dynamic because it could be 20 rows or 200 etc) from one worksheet into another. The issue I am having

How do I save changes made to data within a Userform back to the same row where the data came from?

I have found code to search a table and load cell values into the form. I need to be able to make changes and save the form data back to the table to update th

Return filename with wildcard

sFile = Dir(sPath & sFile) Debug.Print sFile 2022.txt is returned if sFile (the active cell) contains 2022.txt; how can I return the same if sFile contains

Data Mismatch error while using the Update query

I am using the Update query inside VBA to Update one particular column. But I am getting the Data Mismatch in criteria expression error. Please find below the c

How to find a syntax error in my SQL code?

I am trying to compile my code but every time I get the same error: Syntax error (missing operator ) in query expression ' True Status.Subsystem Not LIKE '''

Excel VBA - Set timer goes faster after each loop

I am trying to create a timer that when reaching zero, it calls from the "Database" script, and then repeats the timer again from 30 seconds. Problem is, every

VBA to duplicate large dataset using array

I have data on sheet A and want to duplicate it on sheet B. Because it is a lot of data, I do not want to use copy-paste. If I really simplify it, this is my co

VBA Runtime error 6: overflow on one calculation, but other calculations work

I'm trying to run the following code, but I'm getting a runtime error 6: overflow for the last calculation that I am trying to do. The program stops when it rea

VBA UserForm Frame ScrollTop function not working from class function

This should be a simple task and I've been coding in VBA for 10+ years but I cannot seem to get this to work. I have a UserForm with a MultiPage (with 2 pages)

using DDE get a response from Python to VBA in MS Access

I have a need to pass strings back forth from a python script to a VBA application running in MS Access. Communication from VBA to Python works great! Communica

Want to display notification in Task pane in Word using VBA

I have coded a VBA macro that notifies me whenever a new comment has been added to a document using a MsgBox. I now require that no notification should be in th

Range with Cells Function (Runtime Error - 1004 --> Application-defined or object Defined error)

Could you please help on the below code. I have 2 workbooks and i want to copy the columns from one to another with the matching header. It shows an error in th

Trying to calculate a 1hr range within the last 12hrs of a range with VBA

So I am trying to calculate a test temp for 1hr from the last 12 hours of data. Sometimes this data can be several days some times it can be only 24hrs. The sta