How to hide Columns in Xl dynamically

Hi Team

I am trying to do the following things i

  1. open xl file from a folder which has more than 10 excel sheet.
  2. Open each file and hide some column in that xl file.

I am able to so the first one, but not able to get any function for second one… Is i am missing any key function. Any help wil be much appreciated.

Regards

SS

1 Like

Hi there!

Could you hide columns with uipath? Because I am trying to do the same thing…

Thank you!

HI @Mr_Robot,

use excel application scope.
Select the column and use send hot key-> Ctrl+0 for Column hide Ctrl+9 for Row hide.

Regards,
Arivu

2 Likes

And this is by Invoke Code, @srirseshadri @Mr_Robot :

Worksheet.Range("B:B").EntireColumn.Hidden = True

Sample here: (reuploaded) Hide Column.zip (8.6 KB)

1 Like

In your sample when I download it doesn’t work."

@Mr_Robot whoops. Reuploaded, please kindly check it.

Hi @srirseshadri,

It is a package that to hide and un-hide columns and rows.

Regards
Balamurugan.S

I also made a few examples about hiding and showing columns in Excel, using userforms.
The used columns of sheets with column headers are listed on the listbox based on selected sheet from drop-down list. The selected columns from listbox are hidden.
I hope it works for someone.

Details and sample file at here: Excel hide / unhide columns

This works but rather than specify excelWB as an argument which causes an UNKNOWN TYPE error, define it in the code

Dim excelWB As Microsoft.Office.Interop.Excel.Workbook

and remove it from the arguments.