ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hidding columns not working (https://www.excelbanter.com/excel-programming/344509-hidding-columns-not-working.html)

[email protected]

Hidding columns not working
 
xlsSheet = objWorkBook.Worksheets("Sheet1")

xlsSheet.Range("C:C").EntireColumn.Hidden = True

The program runs find loading all the data and calculating sums on the
sheet but refuses to ever hide that column.

What setting am I missing??

Thanks in adavance
Ryan


Martin Fishlock[_3_]

Hidding columns not working
 
Ryan

I think tht you need to use set, see below.

Set objWorkBook = ActiveWorkbook
Set xlsSheet = objWorkBook.Worksheets("Sheet1")

xlsSheet.Range("C:C").EntireColumn.Hidden = True


This is a slightly neater way of achiveing the same result.

xlsSheet.Columns("C").Hidden = True



Don Guillett[_4_]

Hidding columns not working
 
try
Sub hidecol()
Set xlsSheet = Worksheets("Sheet2")
xlsSheet.Columns("c").Hidden = True
End Sub
--
Don Guillett
SalesAid Software

wrote in message
ups.com...
xlsSheet = objWorkBook.Worksheets("Sheet1")

xlsSheet.Range("C:C").EntireColumn.Hidden = True

The program runs find loading all the data and calculating sums on the
sheet but refuses to ever hide that column.

What setting am I missing??

Thanks in adavance
Ryan





All times are GMT +1. The time now is 06:23 PM.

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