<style> <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-formatther; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-536870145 1073786111 1 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin-top:0in; margin-right:0in; margin-bottom:8.0pt; margin-left:0in; line-height:107%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} .MsoPapDefault {mso-style-type:export-only; margin-bottom:8.0pt; line-height:107%;} @Page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.WordSection1 {page:WordSection1;} --> </style> I need help to hide/unhide rows based on the contents of two of the cells in the same row. My current code doesnt quite do the trick anymore due to having to insert or delete rows:
If Column A has specific data (ex. S.2) and Column L in that row has no dollar amount, I would need to hide the column. If Column L does have a dollar value, then it remains unhidden.
Below is an example of what I have currently. However, the number of rows change (+/-) so I cannot use the code for specific cell values as shown below:
Sub Hide_Unhide_0300()
For Each cell In Range("L158:L183")
If cell.EntireRow.Hidden = True Then
cell.EntireRow.Hidden = False
Else
If cell.Value = "0" Then
cell.EntireRow.Hidden = True
End If
End If
Next cell
End Sub
Thank you for any help you can give
TJ
If Column A has specific data (ex. S.2) and Column L in that row has no dollar amount, I would need to hide the column. If Column L does have a dollar value, then it remains unhidden.
Below is an example of what I have currently. However, the number of rows change (+/-) so I cannot use the code for specific cell values as shown below:
Sub Hide_Unhide_0300()
For Each cell In Range("L158:L183")
If cell.EntireRow.Hidden = True Then
cell.EntireRow.Hidden = False
Else
If cell.Value = "0" Then
cell.EntireRow.Hidden = True
End If
End If
Next cell
End Sub
Thank you for any help you can give
TJ