vba

  1. P

    Runtime error 91 when adding to Zip file.

    Sub CreateZipFile(folderToZipPath As Variant, zippedFileFullName As Variant) Dim ShellApp As Object 'Create an empty zip file Open zippedFileFullName For Output As #1 Print #1, Chr$(80) & Chr$(75) & Chr$(5) & Chr$(6) & String(18, 0) Close #1 'Copy the files & folders into the zip file Set...
  2. B

    VBA-Copy & Paste Merged Cell into Merged Cell

    I'm trying to copy and paste cells from sourceSheet to destSheet. The macro works fine if it's not a merged cell, however, when it comes to merged cells it doesn't paste in the values. Can someone help me with the merged cell block below? It's fine to assume if the sourceCell is a merged cell...
  3. B

    Dynamic range in VBA with Excel functions

    Hi, I'm trying to set the sourceRange as a dynamic range in VBA that starts from cell AC22 and offset with the height of COUNTA(data_date_range)+1, where data_date_range is a named range. and width of Columns(InputClaims), where InputClaims is also a named range. The following formula works...
  4. brendalpzm

    Filter a list based on a text box value

    I created a list box with the following code: Private Sub UserForm_Initialize() Dim arrdata() As Variant Dim lngIndex As Long Dim lngRow As Long arrdata = Worksheets("Current").Range("A1").CurrentRegion.Value With Me.lstHeaders .ColumnCount = 7 .ColumnWidths =...
  5. C

    workday help

    I've been trying to update some old spreadsheets that add 30 days to a date to instead use workday to add 30 working days. I've managed to convert my old dates into the correct dates using workday however, when I do it in that order it completly messes up my pivot tables later. Is there a way of...
  6. D

    VBA find next blank, display value from another cell in the same row, input value in blank

    Hello all, I have searched everywhere for this topic, but could not find anything and I am starting to think it is impossible. Basically, I want that the code finds the next blank in column F. Upon that, a msgbox should pop up with the text value of column C of the same row that the code found...
  7. M

    Extract missing data from the other set

    How do I determine that the elements of both sets are not available in the other set? The right most 2 columns are the columns I would like to get. ABCDE1Set ASet BSet A not in BSet B not in A2HazelAxelHazelAxel3LewisLewisJeromeMatthew4JeromeMatthewAdam5AdamEvangeline6Evangeline
  8. M

    update table row automatically

    I have a table called GastosCC with 3 columns. These Columns are: DATA, VALOR and ITEM. When I change a value in the VALOR column, I want the DATE column to be updated, on the same line as the VALOR column change, with the update date. I did this code, it doesn't show any errors when saving, but...
  9. E

    Please could you help with Named Table

    I need code to stop running when a Table called Table2 is already there. Some reason I can`t get the Function to work with main code? Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim Rng Dim Result As Integer Call DeleteTbl If Selection.Count > 1 Then...
  10. W

    VBA Help - Lookup Match Between 2 Worksheets

    I have two workbooks (both with tens of thousands of rows). Customer_bu_breakdown and Master. My "customer_bu_breakdown" summary sheet contains the information I want to match up. Column A is a customer ID column (which is the same as column F in my sheet1 worksheet). Column B on the...
  11. L

    Perform operation if today is the first of the month VBA

    Hello, I'm building a macro that will perform a data pulling operation each day when I run it. This part of the macro runs great. But, at the start of each month the data should be scrapped and the data storage worksheet should start again from zero. The idea that I have is to bracket my...
  12. R

    change modification date for ALL files under a folder

    Is there a VBA macro that can be created to change all modification dates under a path? example : C:\Users\User\Documents has modification dates dating from 2015-2023 all files are accessed on a monthly bases, instead of going to each file and hitting save since there are 100s of files- and due...
  13. F

    Formulae to sum totals from duplicate references

    I'm trying to build some code that will scan a set of data in column F for a duplicate text reference and, once a duplicate is identified, will sum the associated number in column M of the same row. Each duplicate reference should be summed separately, i.e, a payment of £15 and a payment of £10...
  14. L

    Incorporate SUM by cell color in a formula with HSTACK, MAP, TEXTJOIN and LAMBDA.

    Hi, I have two tables, A and B. Table A is countries planned and Table B is planed driven KM. I also have a summary where I want to see total planed KM, per country, and what calendar weeks that specific country is planed. I have a formula that summarizes planed driven km in a set of specific...
  15. P

    Copy method of worksheet class failed" with pivot table

    I have a pivot table created in Power Pivot, it's on a sheet ("Sups") that when using VBA to copy and paste will work sometimes and in other instances, it will not, triggering the "Copy method of worksheet class failed" error. The line that triggers the error is below. Any thoughts? Sub...
  16. Z

    Automatic datestamping with VBA

    Hi all, I've been trying to find a way to automatically generate datestamps for my worksheet. I would like to have a datestamp automatically update in Column W when any of the data on Columns D-O is changed. For example, when user changes data in E12 today, W12 states 20/09/2023. When a user...
  17. S

    Dictionary with array as the value

    Hi, I have been battling to understand why an array is not being updated where the array is in place of a key/value pair. I have the following in VBA: Dim testDict As Object Dim testKey As String Dim arr(1) As Double Set testDict = CreateObject("Scripting.Dictionary") testKey = "TestKey" arr(0)...
  18. U

    If workbook is open then close

    Hi! I have the below, which allows the user to open the designated file and then run my macro accordingly. I noticed that if that file is already open it doesnt run the rest of the macro properly, so it there a way to say if that file is already open, close the already open file, and then open...
  19. F

    Error 424 Object Required

    Found this code on the net to essentially add a graph when a button is clicked but delete the graph if the button is deselected. I am quite new to vba but I am not understanding why there is an error 424 for the highlighted code and how to resolve it or if this solution can be completed in a...
  20. tlc53

    VBA Save All Relevant Report into One Document

    Hi there, I have a spreadsheet with input pages and then various tabs for the respective reports. Not all report pages are required, and some are hidden (not visible) based on the users' selections on the setup page. I have a formulated a drop-down list, which shows the reports available for...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top