If you want to hide multiple rows but they are not contiguous, e.g., rows 5-6 & rows 9-11, you can use this method by inserting the following code in the VBA module and pressing the F5 button or hitting the Run icon. SubHide_NonAdjacent_Rows_VBA()Rows("5:6").Hidden=TrueRows(...
I have done this on rows before using code like rows("2:" & range("A1").value) and set .hide = true excel vba Share Improve this question Follow edited Jul 9, 2018 at 19:34 CommunityBot 111 silver badge asked Feb 24, 2013 at 3:00 user2103670 1,7111010 gold badges2323 silver...
1).EntireRow.Hidden = MsgBox "Hding Rows 106, 148 and 190" ActiveSheet.Rows("106").Hidden = True ActiveSheet.Rows("148").Hidden = True ActiveSheet.Rows("190").Hidden = True ' try it another way Rows("106").Hidden = True Rows("148").Hidden = True Rows("190").Hidden...
I have a excel work sheet where there is 200 rows. If column k is true I want to hide the rows from the value of column S to the value in column U. if K is false the selected rows are visible. is this the correct syntax to do th Sub Hide_Rows_Based_On_Cell_Value() StartRow...
For Each A In ActiveWorkbook.ActiveSheet.Rows("7").Cells If A.Value = "B" Then A.EntireColumn.Hidden = True End If Next A End Sub Press‘Ctrl+S’to save the code. Close theEditortab. In theDevelopertab, click onMacros, located in groupCode. ...
Going back to my original query, filtering columns would work best if rows that do not contain any data are also hidden when the employee is select. I realise this I may be asking to much of excel here but I am new to VBA and I'm interested to find out it's ca...
Hide or unhide columns to filter data based on user input with VBA code In this example, I will go to filter a data range based on an entered product name. When I enter “Hoodie”, only Hoodie information is displayed and other columns will be hidden at once; and when I enter “All...
Hide columns in Excel With the Hide option in context menu With a single click using Kutools With shortcut With the Format option on the ribbon With plus sign (Group feature) With VBA code Hide unused columns in Excel With shortcut With a single click using Kutools Hide rows in Excel Un...
Sub vba_hide_row_columns() 'hide the column A to c Range("A:C").EntireColumn.Hidden = True 'hide the row 1 to 4 Range("1:4").EntireRow.Hidden = True End Sub And in the same way, if you want to unhide multiple rows and columns. ...
Also, can this work just by entering the value in C8 and not having to press run on the macro? Edit: Solved on mrexcel.com/board/threads/excel-vba-to-hide-a-certain-number-of-hide-rows-on-one-sheet-columns-on-another-based-on-number....