+ Reply to Thread
Results 1 to 8 of 8

Formula bar shows a number based on the date selected from another sheet

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Formula bar shows a number based on the date selected from another sheet

    I have two worksheets in one workbook, one is a dashboard (sheet 1)and the other ones tells it where to grab the data from (sheet2). Example. In B1 of Sheet 1, it will show a number from column B2:B51 in sheet 2, but that number changes based on what date is selected from a drop down list in that same cell B1 of Sheet 1. Each time you change the date from the drop down box in B1 sheet1 it locates that date in Sheet 2 column a2:A51 and shows the number from sheet 2 column B2:b51 in the formula bar in Sheet 1, B1. There must be some special function. It seems there is a formula underneath the drop down list in B1. I am not very good at all with VBA, so I was hoping that I might get some help here. TIA!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,835

    Re: Formula bar shows a number based on the date selected from another sheet

    I'm having trouble untangling this description. It might help a lot if you attach a file.

    In Sheet1!B1, you have a dropdown list of numbers that are from Sheet2!B2:B51. It sounds like this is Data Validation using a List with dropdown.

    But then:

    "that number changes based on what date is selected from a drop down list in that same cell B1 of Sheet 1"

    That's where you're losing me. You can't select a number, and also select a date, and also display yet another number, in the same cell.

    and then

    "shows the number from sheet 2 column B2:b51 in the formula bar in Sheet 1, B1"

    If you select a number from a dropdown list, you will see that number in the formula bar, just as if you had typed a number into the cell.

    Finally

    "There must be some special function. It seems there is a formula underneath the drop down list in B1."

    Not sure what you mean by "underneath".

    Does this file already have VBA? Or do you think you to need to add some?

    And by the way, you never asked a question. I don't know what you need to do.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Formula bar shows a number based on the date selected from another sheet

    What I can't get my spreadsheet to do is (but I have someone's, and I don't know who's because it is protected). On the scorecard tab, in B1, when you are in that cell a number appears in the formula bar that corresponds with column B in Sheet 2. You can only see that number in the formula bar because there is a drop down with the dates from column A from sheet 2 physically in B1 on the Scorecard, but when I select a date, then the number will change in the formula bar to the corresponding date. What will happen eventually is that when data is entered into the Raw data and a date is selected on the Scorecard all the fields will be able to populate with data for that specific date in the raw data. I hope my attachment attached.
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,835

    Re: Formula bar shows a number based on the date selected from another sheet

    Quote Originally Posted by Triscia View Post
    On the scorecard tab, in B1, when you are in that cell a number appears in the formula bar that corresponds with column B in Sheet 2.
    No, in the formula bar I see a date that was selected from the dropdown. This is what your file looks like when I open it and haven't touched anything:
    Triscia1.JPG

  5. #5
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Formula bar shows a number based on the date selected from another sheet

    I understand, but what I am trying to do and from what it looks like in one of the demo files I have, where you have the circle in the formula bar, that would actually show 1 because you have that date selected, but if you selected the next date, 10/26/18 a two would show up because it is all based on sheet 2 columns A and B. What will eventually happen is when a date is selected from the drop down it will populate that data from the raw data worksheet. When you have a couple of months, you can just click on the date and the rest of the worksheet in the Scorecard will populate according to the date.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,835

    Re: Formula bar shows a number based on the date selected from another sheet

    You are asking how to do something that's in a file that you have seen but haven't provided. I can only guess what is in that file. I have never seen any case where the data selected in a dropdown is different than what shows in the formula bar.

    The only possibility I can think of is that the the dropdown is a combo box control on top of the cell rather than a data validation list in the cell. See attached. This requires VBA.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Formula bar shows a number based on the date selected from another sheet

    That is exactly what I want to do, how did you do that?

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,835

    Re: Formula bar shows a number based on the date selected from another sheet

    I created an ActiveX combobox.

    If you do not see the Developer tab in the ribbon, right click on the ribbon and select Customize the Ribbon. Then check the box for Developer tab.

    In the Developer panel, select Insert, and select combobox from the bottom half. Place the combobox over cell B1. Click on Design.

    Double click the combobox. Add the code as shown in my example. There are a number of ways to see my code. One is to click on Design then double click the combobox.

    Every time the combobox is clicked, the code will insert the corresponding number into B1, which is hidden by the combobox.

    Also note that the numbers are listed from 1-50, so the number in B1 is the position of the date. If the numbers change, then the code would have to look up the actual number.

+ 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] formula for counting number of times a date shows in a cell that contains other info
    By Moffa in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-27-2018, 02:38 AM
  2. Copy selected columns from rows one one sheet to another based on a date criteria...
    By bmasella in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2017, 11:07 PM
  3. Summary Sheet based on selected date
    By pmallick in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2015, 01:54 AM
  4. Replies: 5
    Last Post: 12-15-2014, 05:43 AM
  5. Replies: 3
    Last Post: 03-12-2013, 12:14 PM
  6. Create new sheet based on date selected (userForm)
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-17-2011, 04:03 PM
  7. Copy rows to new sheet based on date range selected on a form
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-19-2009, 11:40 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