ExcelNovice17
New Member
- Joined
- Apr 11, 2019
- Messages
- 7
Hi,
I am new to VBA coding and i am still in the learning process. Can anybody help me why the codes in red below are not working. I have different sheets in the excel and i have to hide 2 specific row in one sheet when an option is being selected:
Sub bar()
Dim sht
Dim str As String
sht = "NEW"
str = "-"
If sht.Range("I19").Value = str Then
sht.Rows("35:36").Hidden = True
Else: sht.Rows("35:36").Hidden = False
End If
End Sub
I am new to VBA coding and i am still in the learning process. Can anybody help me why the codes in red below are not working. I have different sheets in the excel and i have to hide 2 specific row in one sheet when an option is being selected:
Sub bar()
Dim sht
Dim str As String
sht = "NEW"
str = "-"
If sht.Range("I19").Value = str Then
sht.Rows("35:36").Hidden = True
Else: sht.Rows("35:36").Hidden = False
End If
End Sub