+ Reply to Thread
Results 1 to 2 of 2

Recorded Macro returns Run-time error '1004'

  1. #1
    Registered User
    Join Date
    12-28-2014
    Location
    Athens, Greece
    MS-Off Ver
    2010
    Posts
    6

    Recorded Macro returns Run-time error '1004'

    Hi,

    I recorded a macro to do the following:

    1. Delete Columns 'F' (Time) and 'G' (Room).
    2. Insert new 'G' column with the title 'Time 1'
    3. Insert new 'I' column with the title 'Time 2'
    4. Insert new row number 1
    5. Insert new row number 2
    6. Fit cells to contents (Select all cells and double click border)

    When I run the macro on a different sheet within the same workbook I get the following error

    Run-time error '1004':

    Method 'Range' of object'_Global' failed

    Here is the VBA script that excel created:

    Please Login or Register  to view this content.
    When I hit the 'Debug' button, it highlights

    Please Login or Register  to view this content.
    Many thanks in advance and happy new year,
    absconditus

    PS I'm VBA-illiterate.
    Attached Files Attached Files
    Last edited by absconditus; 01-05-2015 at 05:02 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Recorded Macro returns Run-time error '1004'

    You do not have Table15 in other sheets so to do it as easy as possible, change

    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    and below
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 10-20-2014, 05:33 PM
  2. [SOLVED] Sort Macro Run-time error '1004': Application/Object-defined error.
    By sam1212 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2014, 10:05 AM
  3. Recorded pivot macro run time error 5
    By cindywylie in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-18-2014, 08:38 PM
  4. Excel Macro Error - Run time error 1004 - Paste method of worksheet class failed
    By kvflynn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2012, 10:51 AM
  5. VBA Code for IF Statement returns Run-Time Error 1004
    By esphero in forum Excel General
    Replies: 3
    Last Post: 03-22-2012, 07:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1