Category "vba"

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

Importing Data from a Password Protected Website

I've the following macros working independently of each other (sort of). I need them working together. First I import data from a URL that points to a CSV file

Insert rows based on cell value and swap cells

I am working on a project to do the following. Data I get from ERP: After running the code it should look like: I want to implement this logic If there is a v

Change Values & Color Based on Day

I have this timesheet and based on a day in the row (F8:AJ8) I want its whole column to highlight with yellow (Color index = 44) if it = "Fri" and change their

Write each row individually and add date in empty column

I have the following code in an Excel VBA module that looks up the ProjID named cell on the worksheet, selects columns needed for output from dbo_Proj_Dash Acce