+ Reply to Thread
Results 1 to 8 of 8

Vba indirect sheet name

  1. #1
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    281

    Vba indirect sheet name

    Hi, so basically I’m trying to get vba to reference to a cell to determine what page to target. Any idea how?

    So for example..
    Worksheets("this will be the worksheet cell reference>’MOI USER Report!D3’").Activate
    But I have no idea how to word it.

    Thanks

  2. #2
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,147

    Re: Vba indirect sheet name

    You have to activate the related sheet and then select the range.

    Such as;

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Vba indirect sheet name

    Are you saying that ’MOI USER Report’ cell D3 is holding the name of another sheet?

    sheets(sheets("MOI USER Report").range("D3").Value).activate
    Ben Van Johnson

  4. #4
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    281
    Quote Originally Posted by Haluk View Post
    You have to activate the related sheet and then select the range.

    Such as;

    Please Login or Register  to view this content.

    On sheet moi user in cell d3 is the sheet name that I want vba to read and use that to target a certain sheet every time I change it. So I’ll change the cell d3 to January then run macro and it will target sheet January or if I change d3 to February it will target sheet February when I run the macro. Tried to explain it as clear as I can but if it’s not enough then let me know

  5. #5
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    281
    I’ll try this tomorrow but yeah that’s the idea! Thanks

  6. #6
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Vba indirect sheet name

    Or

    Please Login or Register  to view this content.

    or
    Please Login or Register  to view this content.
    Last edited by mohadin; 07-21-2019 at 03:03 AM.

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Vba indirect sheet name

    Or
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,072

    Re: Vba indirect sheet name

    Or if your sheet names are numbers
    Please Login or Register  to view this content.

+ 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] Using INDIRECT on another sheet
    By timmtamm in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-26-2017, 05:17 PM
  2. Replies: 2
    Last Post: 10-05-2014, 04:10 PM
  3. Indirect to another tab and sheet
    By amartino44 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-07-2013, 08:03 PM
  4. How to use 'indirect' to sum a column on another sheet
    By sumdumgai in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-06-2013, 10:09 AM
  5. Sum of indirect sheet names with multiple cells (SUM, INDIRECT,SHEETNAME in cell)
    By a1b2c3d4e5f6g7h8 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-12-2013, 08:42 AM
  6. Indirect Formula to return Text from one sheet to cell in another sheet
    By lou031205 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-04-2007, 02:51 PM
  7. [SOLVED] Using the Indirect function with a sheet number instead of a sheet name
    By JDB in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-31-2005, 11:10 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