Category "vba"

Loop through three specific Outlook folders

I have Excel VBA code that imports Outlook mail data from one folder into Excel. I change this for three folders all at the same level (not subfolders). Is ther

For Each Loop stops after deleting one row

I am trying to use an if else statement to delete the entire row when a text value is found in a cell within a given range. The code stops after deleting one ro

Excel convert digits into respective words [closed]

I would like to convert the number of digits in excel into respective words as shown in the picture above. How can I achieve this functionali

System error when opening macro &H800700C1

I was using regularly a macro add-in in excel which stopped working all of a sudden. I get several error messages in the following order when I launch the macro

Exporting sheets as pdf error: Run-time error '1004'. We didn't find anything to print

I'm trying to export all sheets in the workbook as separate pdf files using one button. I followed a YouTube tutorial: https://www.youtube.com/watch?v=FRZ6n3gHt

Save InlineShape picture to file in Word VBA

I am trying to extract a picture from a Word document and save it in a file, using vba. I don't really care about the output format, as long as it is readable.

Copy rows with different lengths into two columns

I am trying to convert data from rows with different lengths into two columns. The value of the first column remains equal to first cell of the row and is copie

How to initialize a listbox to a desired starting point in the list?

I created a macro for Excel which opens a list of all visible sheets in a workbook and goes to the desired sheet as you scroll through the list. The idea is to

Apply code to active document not document opened with Documents.Add

I got a VBA project from colleague who is retired. I have to change a function: Documents.Add Template:= _ "c:\word\Link.dot", _ NewTemplate:=False, Doc

Copy multiple ranges of different length in a loop that searches every Excel file in subfolders and paste on new master worksheet

How do I copy/paste multiple ranges? The code returns the cell A1. What I need: 1- Search and open all Excel files in a folder with subfolders 2- Copy specific

How to call a userform's subroutine within a a separate module's subroutine with VBA

I am wondering how I can call a public subroutine that resides within a userform of two option buttons. Specifically if that user selections optionbutton1 from

How to call a userform's subroutine within a a separate module's subroutine with VBA

I am wondering how I can call a public subroutine that resides within a userform of two option buttons. Specifically if that user selections optionbutton1 from

Add reference to closed workbook and be able to open it

In the sub workbook_open I'm opening 4 workbooks in the background to be able to have references to them without having them "open". (they are not visible) But

Loading Excel row with data using ListObject

I am attempting to load rows in an Excel worksheet, "List of Golfers", from worksheet "Players". On the Players worksheet I have a table named "GolfTrip". On th

VbaCodeCleaner appears as though Focus Rectangle Thicker is checked when it is unchecked

I’m running Excel 2010 & Excel 2003 on a Windows 10 version 21H2 machine. I noticed a change in the appearance of Rob Bovey’s VbaCodeCleaner. A

How to set the PrintArea property of the PageSetup class?

I'm trying to print an area of a page to pdf. I select the range but when I try to set the print area I get: Run-time error '1004': Unable to set the print are

In VBA trying to create a dynamic Sumifs Formula with multiple criterias in multiple sheets

In VBA I am trying to create a sumifs formula with multiple criteria across different workbooks, but I am struggling on the syntax. WorkbookRecut.Worksheets("Su

Vlookup for duplicate status

I've been looking for different approaches to fix my problem, whether it's with vlookup, index, index /match but couldn't figure it out yet. I'm trying to list

Rename Word mailmerge fields in VBA

I want to rename mergefields in a Word document. I use the following script (based on Change value of Word MailMerge field using VBA). I run the script and I se

Capitalized letters in method name after wrongly assigning colUMN variable

I wrongly assigned colUMN variable, then changed to colN but VBA has started to act all Column method with colUMN. When I use intellisense it is written as Colu