+ Reply to Thread
Results 1 to 4 of 4

Named Range in sheet created by Macro

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    Rome, Georgia USA
    MS-Off Ver
    Excel 2010 Professional
    Posts
    5

    Named Range in sheet created by Macro

    I have a workbook in which I have set several macros. One of these macros creates a new worksheet. I need a named range on this new worksheet to select the records I want. When I am on the new worksheet, I can create and use the named range. However, the named range appears to be attached to the new worksheet, meaning that if the new worksheet is not yet present (created from the macro), once the new sheet is created, the named range does not really do anything.

    I have to have this named range (called export -- it is to select the records I want to export to Access) in order to do the export correctly.

    Any ideas here. It seemed to work before but I can't get it to work now.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Named Range in sheet created by Macro

    Maybe the defined name is not corresponding with the name of the new (added) worksheet.

    e.g. defined range
    Please Login or Register  to view this content.
    the new added worksheet is sheet 5.

    In that case the defined name won't find any data (because the sheet is not found).
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    01-25-2013
    Location
    Rome, Georgia USA
    MS-Off Ver
    Excel 2010 Professional
    Posts
    5

    Re: Named Range in sheet created by Macro

    Thanks for your response. Can you help me figure out a workaround? I have to have a named range to run the Import macro in Access. Yeah, I get it now, at least the reason why, because once the Converted sheet is deleted (via macro), the Named Range Reference is lost.

    I may have to figure out a way to specify the actual worksheet in Access rather than the named range. Hmmmm

  4. #4
    Registered User
    Join Date
    01-25-2013
    Location
    Rome, Georgia USA
    MS-Off Ver
    Excel 2010 Professional
    Posts
    5

    Re: Named Range in sheet created by Macro

    Thanks for the responses. I finally got this to work by attaching the macro to select the named range to the workbook rather than the worksheet. Duh.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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