Category "vba"

Why does the use of "Debug.Print" lead to "Overflow" error?

I create a function to sum all the cells within a range as following Function SumTest(rg As Range) As Double Debug.Print "SumTest..." Dim s As Double s

Setting Excel cell value based on another cell value using VBA

I have the following spreadsheet. When ever there is an x in cell B I need to populate the d and e cells in the same row using an equation I have. if there is

How to Paste string of values in single cell of Excel using VBA

I have 2 sheets named "Target Data" and "Pivot". I have filtered data in "Target Data" and now want to copy only visible cells in single cell of "Pivot" sheet.

Word VBA: How to create cross reference to figure in text box?

I'm creating a Word VBA macro to insert a text frame containing an image and its caption, and then create a cross reference to it in the main document text. B

Acces to MySQL automatic data transfer

I have to pass data from Access database to a MySQL database attached to HeidiSQL automatically every minutes. To do that i put the data into excel files format

Create a Range Object from Multiple Areas Items

I have a function that aims to return the visible cells (as a range) after applying an autofilter to an inactive worksheet; the autofilter data is represented b

How to specify the max of a field +1 when defining a SetField value in a Before Insert trigger?

I have a database with a table that has as its primary key an autoincrement number field I call id. In the datasheet view, I want to create some new records us

How to specify the max of a field +1 when defining a SetField value in a Before Insert trigger?

I have a database with a table that has as its primary key an autoincrement number field I call id. In the datasheet view, I want to create some new records us

DLookUp select secondary email if primary is empty or null

I have a form that is selecting emails based on companies that have expired insurances. Some companies have both a Business and personal emails whilst others ha

How to loop through the same cell

Private Sub CommandButton1_Click() Range("C10").Select For Range("C10").Value = 0 To 35 Range("C10").Value = Range("C10").Value + 1 Next En

How to capture the MessageID of an email that was just sent in Outlook using VBA

I generate an email in vba and send it. I have a class which includes the send event for that email so I am able to tell if the email has been sent. My issue is

Check if dynamic array is initialized or contains value - VBA Excel

Is there a way to tell if some dynamic array, for example arr() as String is initialized? IsEmpty and IsNothing seems not to work with dynamic arrays. Currently

.SendUsingAccount selection for .onmicrosoft.com custom domain account

I set up a custom domain for my Microsoft 365 business account ("@company.com" is the custom domain which is really "@company.onmicrosoft.com"). I have two othe

if range of cells contains string then goto

I know this is a topic that is talks about a lot, but I just cant find the answer. I have a range. if in that range there is a word then I need it to go to the

Search string syntax for Restrict method

I'm trying to pull a set of five emails from a specified Outlook folder based on two conditions - the (partial) subject line, and received between two specified

How can I reset recurring meeting in vba?

I wrote vba script to duplication my main calendar to another calendar, including recurring meeting. All is well except when the organizer do out-of-order modif

Filter Pivot Table based on clicked cell text

My workbook consists of 2 sheets: Sheet1 is the primary dashboard that the user sees, while Sheet2 consists of a pivot table and regular table. I'd like to imp

Copy data to another spreadsheet based off value stored in string

I have the below code for one of my financial reports and I'm struggling with updating the code to make it more automated. The code creates a string of the colu

How to use Xlwings RunPython for file name with spaces

I am trying to run a python function called comments() from vba and getting an error with the following code due to spaces in the file name: Sub notes() Dim f

Outlook Redemption error in MS Access: ActiveX component can't create object

Code: Dim Application As Object, namespace As Object Set Application = CreateObject("Outlook.Application") Set namespace = Application.GetNamespace