Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hidden Column in VBA

Selecting 'Group Sheet' and hide column using VBA.

Sheets(Array("sheet1", "sheet2", "sheet3")).Select
Sheets("sheet1").Activate
Range("A:A,D:F,J:J,N:O").Select
Selection.EntireColumn.Hidden = True

The result was only "Sheet1" can hide the column, the other cannot.

Any ideas?

Norika


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Hidden Column in VBA

I don't know about the one line solution, but here's one way:

Sub test()
Dim wks As Worksheet

For Each wks In Sheets(Array("Sheet1", "Sheet2"))
wks.Range("A:A").EntireColumn.Hidden = True
Next
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"norika " wrote in message
...
Selecting 'Group Sheet' and hide column using VBA.

Sheets(Array("sheet1", "sheet2", "sheet3")).Select
Sheets("sheet1").Activate
Range("A:A,D:F,J:J,N:O").Select
Selection.EntireColumn.Hidden = True

The result was only "Sheet1" can hide the column, the other cannot.

Any ideas?

Norika


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hidden Column in VBA

It works. Thank you very much.

Norika


---
Message posted from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Hidden Column in VBA

hi
From book by Green et al "...However, only the active sheet is
affected when you apply changes to a grouped sheet using VBA
code...you need to set up a for...each...next loop to carry out
changes on each member."

regards
Paul

norika wrote in message ...
Selecting 'Group Sheet' and hide column using VBA.

Sheets(Array("sheet1", "sheet2", "sheet3")).Select
Sheets("sheet1").Activate
Range("A:A,D:F,J:J,N:O").Select
Selection.EntireColumn.Hidden = True

The result was only "Sheet1" can hide the column, the other cannot.

Any ideas?

Norika


---
Message posted from http://www.ExcelForum.com/

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hidden Column in VBA

How do I change the command line and let me go to cell A1?

I try to change
from wks.Range("A:A").EntireColumn.Hidden = True
to wks.Range("A1").Select

Of course, it failed.

Norika


---
Message posted from http://www.ExcelForum.com/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
getting rid of a hidden column behind the front column mamie1159 Excel Discussion (Misc queries) 1 February 3rd 10 03:10 AM
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da Tammy Excel Discussion (Misc queries) 3 April 2nd 09 11:40 PM
Hidden Column A ebf kentucky Excel Discussion (Misc queries) 3 June 12th 08 06:34 PM
hidden column oldLearner57 Excel Discussion (Misc queries) 1 March 27th 08 01:40 PM
Hidden column Joe Excel Discussion (Misc queries) 7 August 11th 07 08:33 PM


All times are GMT +1. The time now is 10:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"