Category "vba"

Pivot table data source automatically update

Pivot table data source Please see the above image. I am trying to dynamically update the pivot table data source whenever a new sheet is created. Essentially I

Excel add image to workbook from URL using shapes.AddPicture VBA Macro

So I have the following code that works correctly and uses a column with URLs to add the images to the next column. The problem being that if you send it to so

Converting .xls to .xlsx files with VBA doesn't seem to reduce size

So, I have a bunch of old .xls files that I want to convert to .xlsx files for the sake of disk space economy. Doing it one-by-one is out of the question. I see

Is there a way to change the lookup_value of the Macro code with the identified cell address?

I need to change the lookup_value of RC[-2] with the address Cells(3,2) on the macro code below. Range("D4").FormulaR1C1 = "=VLOOKUP(RC[-2],'[Reference Workbook

Runtime error 1004 Method OnKey of object '_Application' failed

the following code causes runtime error '1004' Method OnKey of object '_Application' failed! Any suggestions? Sub MyAchieve() Dim col As Integer Dim row As

VBA in Outlook to pull specific data into excel

I need some VBA code in outlook to save specific lines of data from emails as per below into an excel folder - see sample excel table below. I need the code to

Process to Import specific text in excel with VBA

I'm trying to import many tables into excel (with fixed width option selected) and I would like it to paste it to certain areas as a function of "i", see below:

finding cell value and delete it in excel vba

I want to return the value of the cell it's found in VBA and clear all of it's content with another 3 rows below it as well, but I'm currently stuck. I can find

How can I call a subroutine after an error?

I'm working on user-proofing a VBA app in Excel and I realized I'm constantly rewriting a lot of the same code to create specific error messages that are fed st

I am trying to populate multiple text boxes with one dropdown list

user can select only one key number at a time and I have placed the code on the listbox in the control both under expression, didn't work- then under code build

I am trying to populate multiple text boxes with one dropdown list

user can select only one key number at a time and I have placed the code on the listbox in the control both under expression, didn't work- then under code build

Iterate through rows and columns, compare dates and if statement true sum and print in new column

this is my first question here and i can't find a solution that works for me. I have a set of data. i need to compare the date displayed in cell 2,2 (until 2,10

Count/Sum a column but exclude #N/A

Currently using the following forumlas to count the number of records in all of column Z that does not have #N/A but it does not work. All the rows in Column Z

Excel Chart not updating correctly with VBA

So I have made a macro to export a chart and then import it into a userform as picture. Import/export is working fince, byt the chart is not updating when the d

How to upload whole Excel range of data to SQL server using VBA (without Wizards or looping row by row)?

I am trying to upload a range of data in excel (same structure as target SQL table) to a table in SQL server using VBA. I do not want to loop row by row but tra

How to fill data bellow last filled cell? VBA ComboBox

I have a combo box, and If I choose the first option I want "15" to be written in "A1", and when I enter another data for a second user I want the data to be in

Send and Save specific emails. Not a sentitem event listener

Edit: I am just going to use an eventlistener. I would delete the post but maybe somebody will find a non eventlistener way to save a sent mailitem before it is

VBA - Macro Copied Workbook, Pivot Data Source not Updating, Error with Pivot Cache?

I'm writing a macro that takes a master file, takes a list of sales people, and for each sales person (RSL) creates individual copies of the master file and edi

Copy Pasting Data from a column to a free column, removing empty lines

I was not looking at VBA for a while, and I would really appreciate your help. Private Sub EvaluateButton_Click() Dim r As Long Dim x As Long Worksheets("tests

Export excel data into new workbook

With some of the success of other automations, I am looking to see if it is possible to move rows of data from my excel workbook into a new one based upon the v