none
Urgent Help- If cell is empty in Active sheet RRS feed

  • Question

  • Hi

    Some one help me with code, its urgent.

    Requirement : I have excel sheet having 8 tabs. One tab have a cell(ex: C7) is blank, if cell is blank then I want to hide entire tab if cell is not blank, the unhide the tab.

    I didn't find the relevant answers in other posts. That's why logging request.

    Tuesday, May 24, 2016 6:50 AM

Answers

  • Hi Madhavam,

    >>I have excel sheet having 8 tabs. One tab have a cell(ex: C7) is blank, if cell is blank then I want to hide entire tab if cell is not blank, the unhide the tab.

    What do you mean with 8 tabs? Do you mean 8 worksheets in workbook? If you have hidden worksheet, how did you set the C7 value? If you want to hide worksheet, you could follow steps below:

    1. Open VBA editor, and double click Sheet1 (Sheet1)
    2. Add below code

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Value = "" And Target.Address = "$C$7" Then
        ActiveSheet.Visible = xlSheetHidden
     End If
    End Sub

    If you want this function in other worksheets, you could follow above steps in other worksheet.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, May 26, 2016 5:55 AM

All replies

  • Hi Madhavam,

    What's the meaning of Tab in Excel? Did you mean Worksheet?

    As you want to use code to get this result, I will move your problem t Excel for Developers Forum:

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.


    Regards,

    Emi Zhang
    TechNet Community Support


    Please mark the reply as an answer if you find it is helpful.

    If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, May 25, 2016 7:02 AM
  • Hi Madhavam,

    >>I have excel sheet having 8 tabs. One tab have a cell(ex: C7) is blank, if cell is blank then I want to hide entire tab if cell is not blank, the unhide the tab.

    What do you mean with 8 tabs? Do you mean 8 worksheets in workbook? If you have hidden worksheet, how did you set the C7 value? If you want to hide worksheet, you could follow steps below:

    1. Open VBA editor, and double click Sheet1 (Sheet1)
    2. Add below code

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Value = "" And Target.Address = "$C$7" Then
        ActiveSheet.Visible = xlSheetHidden
     End If
    End Sub

    If you want this function in other worksheets, you could follow above steps in other worksheet.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, May 26, 2016 5:55 AM