+ Reply to Thread
Results 1 to 6 of 6

Copy named range "headerrows" to each worksheet as created by named range "classes"

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Copy named range "headerrows" to each worksheet as created by named range "classes"

    The below code works to create worksheets from a dynamic named range "classes". I am trying to add header rows, another named range, as the worksheet is created. The macro does copy the named range "headerrows" but doesn't paste even though the worksheet is correctly named and created.

    Any ideas how to properly reference the newly created worksheet??

    Please Login or Register  to view this content.
    Last edited by nigelog; 09-25-2017 at 05:18 AM.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Copy named range "headerrows" to each worksheet as created by named range "classes"

    Hi,

    First I suggest you remove the On Error Resume Next line as it is simply masking whatever the problem is. Then run the code again, but first change this line
    Please Login or Register  to view this content.
    to remove the .PasteSpecial part since the destination argument should be a range object.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Copy named range "headerrows" to each worksheet as created by named range "classes"

    Thanks xlNitwit but
    Please Login or Register  to view this content.
    Give error Object doesn't support this property or method

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Copy named range "headerrows" to each worksheet as created by named range "classes"

    Sorry- lack of coffee. That should of course read
    Please Login or Register  to view this content.

  5. #5
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Copy named range "headerrows" to each worksheet as created by named range "classes"

    Haha, same problem here...time for coffee...That sorted it. Thanks xlnitwit

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Copy named range "headerrows" to each worksheet as created by named range "classes"

    You're welcome. Thanks for the rep.

+ 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. How to use named ranges in VBA code using "Columns" and a variation on "Range"
    By haljam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2014, 02:48 PM
  2. Replies: 5
    Last Post: 11-04-2013, 11:28 AM
  3. Replies: 2
    Last Post: 08-02-2013, 05:24 PM
  4. Named Range = "CountryA" OR "CountryB"
    By f0urchette in forum Excel General
    Replies: 0
    Last Post: 03-05-2012, 04:20 AM
  5. VBA - Input Value If Column Number Equals "x" within Non-Contiguous Named Range
    By greenexcel12345 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2011, 02:23 PM
  6. Replies: 3
    Last Post: 06-04-2011, 10:56 AM
  7. [SOLVED] Access a worksheet level named range with Refers To like "=5".
    By Jeremy Gollehon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2006, 06:10 PM
  8. macro to remove a named range always called "database" & if possib
    By Todd F. in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-25-2005, 02:05 PM

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