+ Reply to Thread
Results 1 to 7 of 7

Macro to autopopulate a section of the sheet, using a named range

  1. #1
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Macro to autopopulate a section of the sheet, using a named range

    Please Login or Register  to view this content.
    I have this code which needs completed. The purpose is that if the text "Day" is put into A72, it will clear out cells A74:A108, and copy and paste the named range Time_Sheet_Stats_Day. If the named range does work well, the cells to be copied and pasted are ADMIN SHEET AM3:AM34. From there I could expand it so it will function based off of other text inputs. Thank you for your assistance.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Macro to autopopulate a section of the sheet, using a named range

    Something like this?

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: Macro to autopopulate a section of the sheet, using a named range

    That isn't working for me. The sheet that is being manipulated is Time Sheet, does that reference need to be in the code?

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Macro to autopopulate a section of the sheet, using a named range

    No, but the code does need to reside in that sheet's object (i.e. don't paste it in ThisWorkbook, or Module1, or anything else but the Time Sheet object)

  5. #5
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: Macro to autopopulate a section of the sheet, using a named range

    When I type "Day" in A72 it gives me a compile error: sub or function not defined. The top line of code is highlighted yellow and the word worksheet is highlighted blue in this line,
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Macro to autopopulate a section of the sheet, using a named range

    Sorry, I forgot an "s". Replace that line with:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: Macro to autopopulate a section of the sheet, using a named range

    Thank you much! It worked.

+ 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] Autopopulate all values in a Named Range based on the value of a cell
    By lhickerson in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-17-2015, 12:10 PM
  2. [SOLVED] How to autopopulate columns on one sheet from a data range on another.
    By NUKLEAR-SLUG in forum Excel General
    Replies: 7
    Last Post: 07-01-2014, 10:52 AM
  3. Named Range in sheet created by Macro
    By HeyLucy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2013, 08:52 AM
  4. excel macro range define to another sheet / named range
    By koi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2013, 10:25 AM
  5. Macro to insert named range in each sheet
    By rbanks in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-28-2006, 10:32 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