+ Reply to Thread
Results 1 to 7 of 7

reference part of cell address from button and part of another cell

  1. #1
    Forum Contributor
    Join Date
    12-06-2012
    Location
    sacramento,calif
    MS-Off Ver
    Excel 2010
    Posts
    217

    reference part of cell address from button and part of another cell

    I have a button located in cell D9, when I click the button I want it to find the value in C9 which would open a worksheet by referencing the value in C9 as the worksheet name. I want the macro to find the row address of the button and combine it with column "C" because I have buttons all the way down Column C and I dont want to make a macro for each one. I am working with this code but its not working:

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: reference part of cell address from button and part of another cell

    You can get the value of the cell in column C by using Offset.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    12-06-2012
    Location
    sacramento,calif
    MS-Off Ver
    Excel 2010
    Posts
    217

    Re: reference part of cell address from button and part of another cell

    thanks, that works but could you add some code for on error for when the sheet is not found?

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: reference part of cell address from button and part of another cell

    Try this.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-06-2012
    Location
    sacramento,calif
    MS-Off Ver
    Excel 2010
    Posts
    217

    Re: reference part of cell address from button and part of another cell

    Thanks, that code it still has an error that says byref argument type mismatch so I made this instead:

    Please Login or Register  to view this content.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: reference part of cell address from button and part of another cell

    Add this to the sub in the code I posted.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-06-2012
    Location
    sacramento,calif
    MS-Off Ver
    Excel 2010
    Posts
    217

    Re: reference part of cell address from button and part of another cell

    Yes, that works great, thanks!

+ 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