+ Reply to Thread
Results 1 to 9 of 9

set worksheet equal to cell value

  1. #1
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    set worksheet equal to cell value

    In a sheet name "Results" range("A5") I have the value "thisworkbook.sheets("Hold")

    I need to reference the sheet in VBA but get the value in range("A5").

    Example: some how do this:


    Please Login or Register  to view this content.
    This would activate sheets("Hold").

    How can I change this to make it work

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: set worksheet equal to cell value

    Maybe something like...

    Please Login or Register  to view this content.
    HTH
    Regards, Jeff

  3. #3
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: set worksheet equal to cell value

    The challenge there is I need to reference that sheet. Like

    Please Login or Register  to view this content.
    I need to set Hat equal to the sheet also because after everything is done, I set hat equal to

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: set worksheet equal to cell value

    and do it again

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: set worksheet equal to cell value

    I think that you should declare Hat as A Range


    Oops - probably a string would be better:|
    Last edited by xladept; 03-09-2015 at 06:48 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: set worksheet equal to cell value

    Hi Mattress58

    Probably something like this...

    Please Login or Register  to view this content.
    Nah...that won't work...
    Last edited by jaslake; 03-09-2015 at 06:49 PM.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: set worksheet equal to cell value

    You probably have to extract the sheet name from the rest of the text, for exampl;e:

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    08-07-2013
    Location
    mo
    MS-Off Ver
    Excel 2010
    Posts
    453

    Re: set worksheet equal to cell value

    thanks for the help. I got it here.

    Please Login or Register  to view this content.

  9. #9
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: set worksheet equal to cell value

    Avoid 'select' and 'activate' in VBA

    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] can I make worksheet name equal a cell
    By Paul B in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 03:05 PM
  2. [SOLVED] can I make worksheet name equal a cell
    By Paul B in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 07:05 AM
  3. can I make worksheet name equal a cell
    By flyingdoc in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  4. [SOLVED] Cell to equal a worksheet's name
    By David P. in forum Excel General
    Replies: 3
    Last Post: 06-10-2005, 08:05 PM

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