ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Hiding rows that meet multiple conditions in excel (https://www.excelbanter.com/excel-discussion-misc-queries/97452-hiding-rows-meet-multiple-conditions-excel.html)

KBV

Hiding rows that meet multiple conditions in excel
 
This is my first time writing a VBA code (custom module). I want to learn how
to write a code that will ask excel to hide rows where a specific criteriia
is met. For ex, " hide all rows where col C has the words 'network' in it".

Or, can I write an if statement in excel to do this??

Thank you!


excelent

Hiding rows that meet multiple conditions in excel
 
Sub tst()

r = Cells(65500, 3).End(xlUp).Row
For t = 1 To r
If Cells(t, 3) = "network" Then
Cells(t, 3).EntireRow.Hidden = True
End If
Next

End Sub



"KBV" skrev:

This is my first time writing a VBA code (custom module). I want to learn how
to write a code that will ask excel to hide rows where a specific criteriia
is met. For ex, " hide all rows where col C has the words 'network' in it".

Or, can I write an if statement in excel to do this??

Thank you!



All times are GMT +1. The time now is 02:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com