understand that there are a lot of posts relating to this but I couldn't find a solution still.
There is a special condition where the Excel auto-calculation is turned off (for performance purposes for other Excel add-ons). However, I do have a button placed to recalculate the workbook.
I have two drop box which changes cell value in F38 This cell value in F38 will in turn set value "X" or "" in a specific row. What is required is that cell in the column that has "X" needs to be hidden when the cell value changes in F38.
The "X" gets populated after I click on the button to recalculate the workbook, however, the macro is not working.
Here is the code
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("F38"), Range(Target.Address)) Is Nothing Then
Dim c As Range
For Each c In Range("H27:EU27").Cells
If c.Value = "X" Then
c.EntireColumn.Hidden = True
Else
c.EntireColumn.Hidden = False
End If
Next c
End If
End Sub
Please advise what is being done wrong here. Currently when the cell value in F38 changes, there is no response.
This block of code is placed in the worksheet change.