+ Reply to Thread
Results 1 to 8 of 8

Adding a cell in sheet selection via vba

  1. #1
    Registered User
    Join Date
    02-05-2020
    Location
    Geneva
    MS-Off Ver
    2013
    Posts
    4

    Adding a cell in sheet selection via vba

    Hi Everybody,

    I recently started to learn vba by myself so don't be too arsch if my questoin seems stupid.

    In order to perform a more complicated task, I would like to create a button which directs me to another sheet. Here is my actual vba :

    Private Sub CommandButton1_Click()

    Sheets("06.01 - 10.01.2020").Select

    End Sub


    I would like to replace "06.01 - 10.01.2020" by the content of a cell in my active sheet, is it possible ? Does it change anything if the cell I want to use is on another sheet ?

    Also, is it possible to implement a formula in this code ? (something like
    Sheets("=RANK.EQ(A1:A55)").Select for example)

    Thanks in advance for any answer that you may have !!

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Adding a cell in sheet selection via vba

    Please Login or Register  to view this content.

    where the sheetname is in A1

    for your 2nd question yes but its not clear what you are asking, where does the answer go?

  3. #3
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Adding a cell in sheet selection via vba

    Value from cell:

    Please Login or Register  to view this content.
    Or value from function:

    Please Login or Register  to view this content.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  4. #4
    Registered User
    Join Date
    02-05-2020
    Location
    Geneva
    MS-Off Ver
    2013
    Posts
    4

    Re: Adding a cell in sheet selection via vba

    Thanks for your answer !

    For the 2nd, the formula I wanted to use was LARGE not RANK.EQ, sorry for that.

    Let's say we have numbers in cells A1 to A55 (these numbers are also the names of the 55 sheets in my workbook). Can I insert LARGE into my vba so that the button directs me to sheet whose name is the 25th biggest number ?

  5. #5
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Adding a cell in sheet selection via vba

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-05-2020
    Location
    Geneva
    MS-Off Ver
    2013
    Posts
    4

    Re: Adding a cell in sheet selection via vba

    thank you for the answer !

  7. #7
    Registered User
    Join Date
    02-05-2020
    Location
    Geneva
    MS-Off Ver
    2013
    Posts
    4

    Re: Adding a cell in sheet selection via vba

    thank you !!

  8. #8
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Adding a cell in sheet selection via vba

    You welcome. Happy to help.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

+ 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. Adding comments to cell selection(data validation)
    By russkris in forum Excel General
    Replies: 11
    Last Post: 05-31-2017, 04:34 PM
  2. [SOLVED] Adding a string to each cell in a selection
    By konx in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-31-2015, 10:43 AM
  3. Calculating/adding userform textbox values based on combobox selection and display to cell
    By SpreadsheetGirl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2015, 08:57 AM
  4. Unlock Sheet on cell selection?
    By welshman010 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-03-2014, 08:13 AM
  5. [SOLVED] Use active cell address from one sheet as range selection for another sheet
    By JJGF in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-16-2013, 10:26 PM
  6. Hiding row in a sheet based on cell selection in another sheet
    By akderitend in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-11-2013, 09:53 AM
  7. [SOLVED] Temporary Sheet with Cell Selection
    By Sophie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-06-2005, 02:06 PM

Tags for this Thread

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