Thread: hide column
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
WhytheQ WhytheQ is offline
external usenet poster
 
Posts: 246
Default hide column

....."quick and dirty": nice way to describe code!
If you fancy having a laugh, and looking at a really 'unusual' forum
poster, then try doing a search using "aaron.kempf@gmail" (make sure
you use Search Groups, rather than just This Group)
Mr Kempf certainly has a way with words and doesn't suffer fools
gladly!

Rgds
J


On Nov 27, 1:34 pm, "Andrew Taylor" wrote:
Agreed, my original posting went a bit too far in the "quick & dirty"
direction ;) Your "For Each cell in Rows(3)" construction is much
nicer.

Andrew



WhytheQwrote:
Hi Richard this doesn't really help if I've got 255 in 50 different
routines.
Encouraging generic code would be better approach.


Apologies for getting on my high horse.
J


On 20 Nov, 14:44, Richard Buttrey
wrote:
On 20 Nov 2006 05:17:50 -0800, "WhytheQ" wrote:


Just change the 255 to 17576


HTH


....and what about when we get spreadsheets with more columns?


On 14 Nov, 16:55, "Andrew Taylor" wrote:
Try this:


Dim i As Integer, ws as worksheet
For Each ws in ActiveWorkbook.Worksheets
For i = 1 To 255
If ws.Cells(3, i).Value = 1 Then
ws.Columns(i).Hidden = True
End If
Next
Next


Steph wrote:
Hi. Is there a way to have vba scan every visible worksheet, and look in
row 3. If there is a 1 in a cell in row 3, hide that column? Thanks!- Hide quoted text -- Show quoted text -__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -