+ Reply to Thread
Results 1 to 2 of 2

how to insert in macro - sheetname as function

  1. #1
    Registered User
    Join Date
    01-21-2013
    Location
    Manila
    MS-Off Ver
    Excel 2010
    Posts
    3

    how to insert in macro - sheetname as function

    Please help!

    How do I use the name of the first sheet as a variable in macro?

    I usually include is this line

    Sheets("1st Period").Select

    What if the name of the first sheet varies but I will use the same macro?
    What should the line look?

    I thought of getting the name of the sheet in a cell,, but could not make use of it also,, :P

  2. #2
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: how to insert in macro - sheetname as function

    instead of Sheets("1st Period").select use Sheets(1).select, the first asks excel to call up the sheet named "1st Period" the second asks excel to call up the first sheet (change the number to get sheet 2, 3, 4 etc)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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