+ Reply to Thread
Results 1 to 5 of 5

Modifying existing code

  1. #1
    Registered User
    Join Date
    05-23-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    8

    Modifying existing code

    I found this code online, that copies "Sheet2" and renames the new worksheet based on a range listed on "Sheet1" (starting in A2). If "Sheet1" was renamed to "Listing", how do I modify this code in order to make sure that the code will always pull from "Listing" and not "Sheet1"?


    Please Login or Register  to view this content.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,620

    Re: Modifying existing code

    The macro just pulls data from column A in the sheet which is active when it is called.
    The only sheet which is explicite named here is Sheet2, which is used as a template for newly created sheets.
    if you want to make sure it is always pulling data from Listing sheet change in first few lines:

    Please Login or Register  to view this content.
    Last edited by Kaper; 03-13-2015 at 02:51 PM.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    03-12-2015
    Location
    Massachusetts
    MS-Off Ver
    2013
    Posts
    2

    Re: Modifying existing code

    just ad Sheets("sheet name").select to the code. then no matter what sheet you are on the code will always go to that sheet first.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-23-2013
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Modifying existing code

    Thank you Kaper and sjd371, both ways worked for me and i'm good to go now.

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,620

    Re: Modifying existing code

    you are welcome. would be nice if you mark thread as solved.

+ 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. Modifying the code in an existing workbook to add extra Category fields
    By adriantainsh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2014, 09:08 AM
  2. [SOLVED] Add two more columns, modifying an existing VBA code help.
    By Anka in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 02-17-2013, 01:24 PM
  3. Modifying Existing Code to Check if the entry exists
    By jason_kelly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-31-2010, 10:39 AM
  4. Modifying existing VBA code to find different file name
    By PittsburghEng in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2010, 03:24 PM
  5. Help modifying existing VBA code
    By camcafe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-28-2008, 11:02 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