Forum Discussion

Budman361530's avatar
Budman361530
Brass Contributor
Sep 30, 2022

Making a "If" function work with a sheet tab name?

I have a macro that makes a sheet.  In this case it's "Adder 2, 3... etc."

 

Adder sheet 1 is existing.

By clicking the "Add" button you can make new "Adder" tabs, the second adder tab showing as "Adder (2)"

I am trying to figure out a way to use an "If" function that will recognize/populate whatever is typed in the field next to Adder 1, Adder 2, Adder 3... etc... in the first screen shot, and insert it into the top of the corresponding sheet when it's made.  

 

Example.... 

Test 1 that is typed into the cell next to Adder 1 will appear in cell A1 of sheet "Adder 1", and "test 2" will appear in the cell of A1 in sheet "Adder (2)"... etc. 

 

4 Replies

    • Budman361530's avatar
      Budman361530
      Brass Contributor

      NikolinoDE,

       

      I downloaded your recommendation, but cannot find what I am trying to do.  Not sure if I am explaining correctly, so I made a sample workbook.    See attached.  Ultimately, I am trying to get the values in Cells C4 through C8 to populate in the corresponding "Adder" sheets cell C5, when you click the  "Button #1". I tried  INDIRECT Function, IF function, MATCH, VLOOK UP.  Not sure if I did them wrong, or they are not the correct functions?

      =INDIRECT('Summary Page'!B4:B8&" '!")

      =IF(INDIRECT('Summary Page'!B4:B8&" '!"),'Summary Page'!C4:C8," ")

      =IF(MATCH(" '!",'Summary Page'!B4:B8),'Summary Page'!C4:C8," ")

      =VLOOKUP(" '!",'Summary Page'!B4:C8,2,0)

       

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        Budman361530 

        The Summary Page sheet in your sample workbook is empty apart from the button, and there is no code in the workbook...

Resources