Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
| Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 12th, 2005, 07:59 PM
Registered User
 
Join Date: Feb 2005
Location: , Ny, .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default hide column in rnage where values found

Im using the code:[vb]

Sub printtermination()

Range("B3:BU3").Select

Application.ScreenUpdating = False


For Each cell In Range("B3:BU3")

If cell.Value = "1" Then
Debug.Print cell.Address & " 1"
cell.EntireColumn.Select
With Selection
.EntireColumn.Hidden = True
End With
End If
DoEvents

If cell.Value = "0" Then
Debug.Print cell.Address & " 0"
cell.EntireColumn.Select
With Selection
.EntireColumn.Hidden = False
End With
End If
DoEvents
Next cell

Application.ScreenUpdating = True


End Sub

This code gets about half way through and messes up...?

$B$3 0
$C$3 0
$D$3 0
$E$3 0

$F$3 1
$G$3 1

$H$3 0
$I$3 0
$J$3 0
$K$3 0

$L$3 1
$M$3 1

$N$3 0
$O$3 0
$P$3 0
$Q$3 0
$R$3 0

$S$3 1

$T$3 0
$U$3 0
$V$3 0
$W$3 0

$X$3 1
$Y$3 1

$Z$3 0
$AA$3 0
$AB$3 0
$AC$3 0
$AD$3 0

$AE$3 1
$AF$3 1

$AG$3 0
$AH$3 0
$AI$3 0
$AJ$3 0

$AK$3 1

'Mistakes start here
$AL$3 0
$AM$3 0
$AN$3 0
$AO$3 0

$AP$3 1
$AQ$3 1

$AR$3 0
$AS$3 0
$AT$3 0
$AU$3 0
$AV$3 0

$AW$3 1

$AX$3 0
$AY$3 0
$AZ$3 0
$BA$3 0

$BB$3 1
$BC$3 1

$BD$3 0
$BE$3 0
$BF$3 0
$BG$3 0

$BH$3 1
$BI$3 1

$BJ$3 0
$BK$3 0
$BL$3 0
$BM$3 0
$BN$3 0

$BO$3 1

$BP$3 0
$BQ$3 0
$BR$3 0
$BS$3 0

$BT$3 1
$BU$3 1


any help is appreciated..thanks!!

 
Old February 13th, 2005, 09:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , Denmark.
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Which mistakes?
 
Old February 13th, 2005, 10:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , Denmark.
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Didn't this answer help you?
http://xtremevbtalk.com/showthread.p...0ac95&t=211056




Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView - Hide column and retrieve value snufse ASP.NET 2.0 Basics 1 July 24th, 2008 03:22 PM
unable to hide a column sameer123 ASP.NET 1.0 and 1.1 Professional 2 September 25th, 2007 08:48 AM
hide certain column in a table lscjtw XSLT 2 August 2nd, 2007 01:26 PM
could i hide a column at run time from datagrid alyeng2000 ASP.NET 1.0 and 1.1 Basics 10 January 17th, 2004 03:26 PM
how do i hide a column from grid alyeng2000 ASP.NET 1.x and 2.0 Application Design 3 December 29th, 2003 10:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.