+ Reply to Thread
Results 1 to 2 of 2

VBA calling the name of a Sheet from a cell

  1. #1
    Registered User
    Join Date
    11-03-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    VBA calling the name of a Sheet from a cell

    Hi everyone,
    I have a simple question:

    I have a macro for printing a sheet whose name is in a cell

    Sub printchartnew1()
    ' printchartnew1 Macro

    Sheets("TF90").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
    IgnorePrintAreas:=False
    End Sub


    Now in a separate sheet of the same workspace I have a list of the sheet names:
    A
    1 TF90
    2 TF88
    3 TF87
    4 TF65
    5 TF78
    6 TF43

    I want to create a macro which prints the sheet whose name is in the list. For example A2 for printing the Sheet labelled TF88.

    Finally I would like a macro which prints ALL the sheets whose name are on that list.

    I think I have to change something in here:

    Sheets("TF90").Select

    Actually in the macro I am selecting the sheet and then printing but I guess that the selection step can be skipped somehow....

    Any help would be extremely appreciated.
    Last edited by Gio_ita43; 11-03-2011 at 11:25 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA calling the name of a Sheet from a cell

    Try this code. Modify as necessary -
    Please Login or Register  to view this content.
    I have a list of sheet names starting from A1 in Sheet1. The loop goes to each sheet and performs the actions without the select statement.

+ 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