Cliffork
New Member
- Joined
- Feb 12, 2020
- Messages
- 43
- Office Version
- 365
Hello,
I work in an electronics lab and manage a compilation file that we use for data entry whenever an instrument is returned for repair.
My first Sheet is called 'Customer Information', where we fill out all contact information and data about their RMA.
In cell B18 I have a drop down list to enter, what kind, if any, of handheld device was sent in alone with their instruments.
In another sheet titled 'Final Inspection', row 65 asks what software version they are running.
My final goal is to make it so that if "na" or "no" is entered in cell B18 on 'Customer Information' , that row 65 on 'Final Inspection' is hidden since it is unnecessary.
I have a similar hidden row in 'Customer Information' that hides row 17 if row 16 is a no, and it seems to work since it is on the same sheet. I tried making another cell in row 65 equal the value of B18, and use the same If/Then formula, but it doesn't seem to work. I've tried a few others I found on these forums but I can't seem to get them to work. Could anyone give me a hand? What I'm currently using is as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("G65").Value = "na" Then
Rows("65").EntireRow.Hidden = True
Else: Rows("65").EntireRow.Hidden = False
End If
End Sub
I also tried to use the one below to some success, but only when the data was entered directly into cell G65. If G65 uses formula ='Customer Information'!B18 the macro no longer functions properly.
Private Sub Worksheet_Change(ByVal Target As Range)
With Sheets("Final Inspection")
Select Case Target.Address(False, False)
Case "Customer information(B18)"
.Rows(65).Rows.Hidden = Target.Value = "na"
.Rows(65).Rows.Hidden = Target.Value = "no"
End Select
End With
End Sub
I work in an electronics lab and manage a compilation file that we use for data entry whenever an instrument is returned for repair.
My first Sheet is called 'Customer Information', where we fill out all contact information and data about their RMA.
In cell B18 I have a drop down list to enter, what kind, if any, of handheld device was sent in alone with their instruments.
In another sheet titled 'Final Inspection', row 65 asks what software version they are running.
My final goal is to make it so that if "na" or "no" is entered in cell B18 on 'Customer Information' , that row 65 on 'Final Inspection' is hidden since it is unnecessary.
I have a similar hidden row in 'Customer Information' that hides row 17 if row 16 is a no, and it seems to work since it is on the same sheet. I tried making another cell in row 65 equal the value of B18, and use the same If/Then formula, but it doesn't seem to work. I've tried a few others I found on these forums but I can't seem to get them to work. Could anyone give me a hand? What I'm currently using is as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("G65").Value = "na" Then
Rows("65").EntireRow.Hidden = True
Else: Rows("65").EntireRow.Hidden = False
End If
End Sub
I also tried to use the one below to some success, but only when the data was entered directly into cell G65. If G65 uses formula ='Customer Information'!B18 the macro no longer functions properly.
Private Sub Worksheet_Change(ByVal Target As Range)
With Sheets("Final Inspection")
Select Case Target.Address(False, False)
Case "Customer information(B18)"
.Rows(65).Rows.Hidden = Target.Value = "na"
.Rows(65).Rows.Hidden = Target.Value = "no"
End Select
End With
End Sub