+ Reply to Thread
Results 1 to 2 of 2

Macro to print worksheet specific named range in footer for specific worksheet

  1. #1
    Registered User
    Join Date
    07-04-2013
    Location
    brisbane, australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Exclamation Macro to print worksheet specific named range in footer for specific worksheet

    Hello,

    I'm still a beginner with VBA/macros but I've done my head in trying to work out the following two questions on my own so anyone's help would be greatly appreciated.

    I have a workbook with a number of worksheets, a few of which have a worksheet specific named range for a cell called "WS-Ref". My first issue is that I want this worksheet reference to print on the footer of the worksheet that it's for. The way the code is at the moment prints the Active Worksheet's "WS_Ref" on all of the footers however I want each footer to contain it's own "WS_Ref". I have tried using ws.Range however I get the following: "Runtime error '1004': Method 'Range' of object '_Worksheet' failed". The code I have is as follows (with the part I'm having issues with in red font):

    Please Login or Register  to view this content.
    My second issue with the above macro is that there are approx. 40 worksheets in the workbook so when choosing to print a worksheet it takes a while before the code runs and does all the above before printing the worksheet needed. Is there any way to fix/change this above code so there isn't this lag each time a worksheet needs to be printed?

    Again, all help will be greatly appreciated!!

    Thanks

  2. #2
    Registered User
    Join Date
    05-17-2009
    Location
    Port St. Lucie, FL
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Macro to print worksheet specific named range in footer for specific worksheet

    Try this as your last line:
    ["Ref: " & Range("WS_Ref") & ws.Range("A6").Value]

    It should change with each ws as it loops through.
    FloMM2

+ 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. Adjust existing macro to pick up specific named worksheet and copy to named range
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-08-2017, 12:03 PM
  2. Get data from userform to input into specific worksheet with named range
    By Mark Dynes in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-17-2017, 12:18 PM
  3. How to delete specific columns based on a named range of values from a worksheet
    By dronofrio in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2012, 10:56 AM
  4. Print Macro for specific Ranges in a worksheet
    By chrisjack in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-16-2012, 03:59 PM
  5. [SOLVED] Macro:Extract value from specific cells in different worksheet named in column A
    By VBNewbie1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2012, 10:20 PM
  6. [SOLVED] Macro to Set Worksheet to Specific Print Settings
    By boldcode in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-15-2011, 10:59 AM
  7. create named range specific to worksheet
    By beliavsky@aol.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2005, 12: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