+ Reply to Thread
Results 1 to 4 of 4

InputBox to select named range and then SaveAs

  1. #1
    Registered User
    Join Date
    08-06-2012
    Location
    hobart
    MS-Off Ver
    Excel 2010
    Posts
    3

    InputBox to select named range and then SaveAs

    Hi,

    I'm using the following code to copy worksheets based on the contents of named ranges into a new workbook where the named range is entered into an InputBox.
    The first part of the procedure works fine but when it gets to the SaveAs line it throws up run-time error 1004. I can get it to work by manually entering the file name but I would like the file to be saved as the name of the range ie. myRange.

    Any help is appreciated.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    08-06-2012
    Location
    hobart
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: InputBox to select named range and then SaveAs

    I should have noted that the named ranges are actually dynamic. eg. =OFFSET(List!$N$1,1,0,MATCH("*",List!$N:$N,-1)-1)

    I just discovered that if I change the ranges from dynamic to normal ie =List!$N$2:$N$15 then the previously posted code works.

    Does anyone know how to deal with dynamic named ranges in this instance?

    Many thanks

  3. #3
    Forum Guru mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,206

    Re: InputBox to select named range and then SaveAs

    is myRange a named range (visible in the Name Manager) or is that just the VB variable that you use to receive the user input?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Registered User
    Join Date
    08-06-2012
    Location
    hobart
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: InputBox to select named range and then SaveAs

    Hi Mike,

    myRange is a variable where the user enters the actual range name via the InputBox.

+ 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. [SOLVED] Use Inputbox to find then select an offset range and print for ALL sheets
    By FuzzyDove in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-23-2015, 02:38 PM
  2. [SOLVED] Inputbox to select range in another workbook
    By Guerolito in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-02-2013, 03:55 AM
  3. [SOLVED] Select range with InputBox. Is it possible?
    By Isabel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-13-2013, 06:36 AM
  4. [SOLVED] Select range via Inputbox
    By nakul2617 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-21-2013, 07:46 AM
  5. saveas filename=inputbox value?
    By jazbath in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2008, 07:26 PM
  6. IF statement...If InputBox value equals any value within a certain named range...
    By Cottie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2007, 03:34 AM
  7. Trouble Using InputBox Method to Select Range from Other Sheets
    By pao_e_vinho in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2006, 06:48 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