1. X

    Manual Ctrl+C to copy from excel, VBA to paste values in specific range in different workbook (Getting 1004 error)

    Hello, I've been struggling with this for hours now. I believe the solution is simple, but I can't figure it out. The complete steps being taken are as follows... Open external workbook Manually select range (which varies often) Press Ctrl+C or right click select Copy, to copy selected range...
  2. I

    How to have a message box appear if referenced workbook name is not correct?

    Hello. I made a long macro for myself and coworkers that references one static workbook multiple times. However, I have to edit the coding behind it once in a while and resend it. When this happens they are told to delete the others and make sure the name is the same. However, some are not tech...
  3. O

    Excel VBA create listboxes not working - error 1004

    Hi, Done some searching and sheet is not protected as others have had the issue with - its just being created as a new workbook. So this is part of a word macro I am updating that I wrote before, but inside the macro I call the Excel creation function. The goal is I want to create an excel...
  4. S

    Run-time error '1004

    Hello Experts: I have a rather irritating problem that does not make sense to me and I am hoping that someone can help please. I have some code that: Creates a list of files to be opened Opens each file in the list and scrapes some specific data from each file opened if present Places the...
  5. G

    VBA Loop for copy and paste with search

    Hi There, Thank you in advance for taking the time to read this. I've tried to search for the answer but to no avail so I'm hoping some very kind person will be able to help put me out of my misery. I'm trying to search for a specific term within a column of a worksheet, if that is found...
  6. D

    Please Help! Run-Time error 1004; Method range of object worksheet failed.

    Hello, I am in the process of transferring a lot of the sheet calculations and conditional formatting into vba for efficiency and in the process I am receiving an error that I cannot seem to figure out, "run-time error 1004; method range of object worksheet failed". I have attached all the...
  7. M

    1004 error on Macro to Delete All Names in ActiveWorkbook

    Hi- My Company's software macro creates hidden names in our workbooks making them clunky and unnecessarily large, so I am trying to get a macro to first unhide all names in the name manger, then delete all, except the print range. Except I am gettin a 1004 name syntax error on the n.Delete...
  8. A

    Runtime Error 1004: Unable to get pivotfields property of the PivotTable Class

    Hello Community, Looking for a little VBA love. Current macro simply done by recording. So I couldn't screw up the language code. I have 2 sheets: 1 for Brands and Brands Top Gain Loss. I would like to get rid of one sheet and allow a macro for Sort by "Dollar Sales" and "Dollar Sales Chg YA"...
  9. B

    Can't add "=" before Cells.Value equation [VBA] 1004 Error

    I have a dynamic equation that is filling across multiple cells, so until the equation is completely generate, I have not included the "=" sign at the beginning. I thought adding it would be as simple as Cells(i,j).Value = "=" & Cells.Value, but this does not work. I have tried the same thing...
  10. FracinDean

    VBA Code to Retrieve Default Values for Empty Cells

    My objective is to use the Worksheet_Change event to test if any cells requiring a value have been cleared, and then to retrieve the default values and put them in the cell. All the cells requiring a value have a named range, and all the default named ranges are the same, except with the...
  11. J

    Unable to set the currentpage property of the pivotfield class

    Hi there, Leveraging some posts online, I have created a macro that should allow the user to make filter selections on one sheet while having the actual pivot table on another sheet. Sub Update_Pivot() Dim ws As Worksheet Set ws = ActiveWorkbook.ActiveSheet Dim wsname...
  12. F

    Macro works perfect on xls.files but not on xlsx.files

    Dear All, Run time error 1004 when using sheet with more than 65000 lines .xlsx ). Even if they are not used. I fear it has to do with the way I search the last used row. Endrowhelp = Firstref.Column Cells(50000, Endrowhelp).Select Selection.End(xlUp).Select myEndRow =...
  13. D

    Error 1004 Help. I'm over my head!

    Hello everyone, First time poster to the board and fairly new to VBA macrosfor excel. Please bare with me on this post if it is confusing. I have managed to Frankenstein together code that allows fora worksheet to be created based off of a template sheet, followed by adding anadditional...
  14. R

    Run-time error '1004': Application-defined or object-defined error

    Code for work, so posting just some of it.. Code that matter for function: public function compare(...,table As Range) dim i as integer i = 1 table.Cells(i,1).value = "Test" end function Throwing error "Run-time error '1004': Application-defined or object-defined error" Any ideas on why this...
  15. M

    Runtime Error 1004

    I keep getting a Runtime Error 1004 with a particular macro. The debug option always take me back to the "UsedRange" portion of: If ws2.Range("A:A" & Rows.Count).End(xlUp).Row > 4 Then ws2.UsedRange.Offset(4).Clear What's so frustrating is that if I copy and paste the contents to a brand new...
  16. K

    VBA 1004 error - range, insert row.

    Hi all, I am totally new to VBA, its my first code. I wanted to create macro which could insert a row after finding different value. I managed to write something like this. Could you pleas check what is causing the error 1004 - Application defined or object-defined error? Sub InsertRow() Dim...
  17. U

    2 Workbooks, updating 1 Value [Err 1004]

    I receive an automated report and use it to update an internal file for my department. All columns are formatted almost identically between the two sheets (at least for the two criteria I am working with). My goal is to have a macro that will update our internal file to match the information...
  18. Q

    1004 Error. That name is taken

    Hi team, Code below. I t is meant to run through the work book and format the Tab name with the name in D6. It has been working fine for a couple months but now it refuses to budge from this error on this line. There are on 10 names that appear repeatedly. Sub Tab_name() Dim ws As Worksheet...
  19. F

    Pastespecial method of range class failed 1004

    Hi, I have 2 sets of code. One copies the form and the second pastes it. (the ancillary functions are sheet hide unhide etc) The problem is, at times the codes work perfectly fine. But sometimes i get the "pastespecial method of range class failed 1004" error. I have created an excel ribbon...
  20. C

    Runtime 1004: Range class method failed

    Hi MrExcel Forum, First time poster (to any forums), was wondering if anyone can help me with this tiny bit of code on here. I see similar issues posted to the forums but nobody says what the underlying cause is so I'm not sure how to fix my particular situation. What I want it to do: Go...

Watch MrExcel Video

This Week's Hot Topics

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