![]() Instead of selecting the columns by mentioning the name, we can hide any column by their sequence as well. Here we can see, column B and C are hidden now. Range("B:C").EntireColumn.Hidden = True End Sub Then in the range, we need to select those columns as shown below. If we want to hide more than one column together. We will see, column C is now hidden, now it only shows columns A, B, and D. Now compile the code and run it by clicking on the Play button located below the menu bar in VBA. Range("C:C").EntireColumn.Hidden = True End Sub As we want to hide the selected columns C from the range, so we would select TRUE here. If we choose Hidden as TRUE then, it would as hiding function or if we choose FALSE then it would work as unhiding function. Now, to make this happen, we can choose answer TRUE or FALSE. Here we are hiding column C.Īs we want to hide entire Column C, select the EntireColumn function followed by Hidden as shown below. In the newly opened Module, write the subcategory of VBA Hide Column or we can choose any other name as per our choice as shown below.įirst, select the column/s that we need to hide.
0 Comments
Leave a Reply. |