View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Chickering Charles Chickering is offline
external usenet poster
 
Posts: 272
Default Hiding columns based upon a value (or vice versa)

Private Sub ButtonA_Click()
Dim cnt as long
Dim lCol as Long 'Last Column
Rows(3).EntireColumn.Hidden = False
lCol = Cells(3,Columns.Count).End(xlToLeft).Column
For cnt = 1 to lCol
If Cells(3, cnt) < "A" Then Columns(cnt).Hidden = True
Next
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"Matthew Balch" wrote:

How do I do VB to read a row then act on the relevant columns.

Say in row 6 I have 3 different variants, A B & C. If user pushes button A I
only want all the columns with A in row 3 displayed.

How do I do this?