I have created a workbook using VB.net and I need to Hide all columns to the right of Column K in all worksheets.
To hide column K alone I can do
Worksheet.Range("K:K", missing).EntireColumn.Hidden = true
How can I hide column K and ALL the columns to the right of column K?
The Following macro can do it but how can I include it in my VB.Net button click event
Sub Macro2() Columns("K:K").Select Range(Selection, Selection.End(xlToRight)).Select Selection.EntireColumn.Hidden = True End Sub
Help me out!