Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Hiding columns based upon a value (or vice versa)

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
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?

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
If Hours 0, If Volume <= 0,(and vice-versa) then.... Steve Excel Worksheet Functions 4 November 21st 09 01:30 PM
Possible to "rotate" range of cells so columns are rows and vice versa? [email protected] New Users to Excel 3 January 5th 07 05:21 PM
I want columns of worksheet to become rows and vice-versa. Swapping rows and columns Excel Worksheet Functions 1 June 10th 06 06:03 AM
Formula to convert/transpose columns to rows (and vice versa) markx Excel Worksheet Functions 5 March 10th 05 02:18 PM
Can I rotate excel sheets so columns are rows & vice-versa (i.e.. JamesR Excel Discussion (Misc queries) 3 January 12th 05 02:18 PM


All times are GMT +1. The time now is 11:52 AM.

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

About Us

"It's about Microsoft Excel"