Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mangesh_yadav
 
Posts: n/a
Default


Hi,

I thought you were using a listbox from the Control Toolbox menu.
Anyway, since you are using the Data Validation, you need to use the
following code. Assuming that the data validation is for the cell A1,
use

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$A$1" Then

Worksheets("Trial").Columns("A:AD").EntireColumn.H idden = False

If Target.Value = "Alpha" Then
Worksheets("Trial").Columns("K:K").EntireColumn.Hi dden = True
Worksheets("Trial").Columns("X:AD").EntireColumn.H idden = True
ElseIf Target.Value = "Beta" Then
Worksheets("Trial").Columns("D:D").EntireColumn.Hi dden = True
Worksheets("Trial").Columns("K:L").EntireColumn.Hi dden = True
ElseIf Target.Value = "Alpha Infinite Depth" Then
Worksheets("Trial").Columns("X:AD").EntireColumn.H idden = True
ElseIf Target.Value = "Beta Infinite Depth" Then
Worksheets("Trial").Columns("D:D").EntireColumn.Hi dden = True
Worksheets("Trial").Columns("L:L").EntireColumn.Hi dden = True
End If

End If

End Sub


This code should go in the module of the sheet where you will select
the value alpha or beta.... Also change $A$1 from the code above to
suit your needs.

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=379611

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
Auto Hide Columns Phil Osman Excel Discussion (Misc queries) 6 September 13th 06 07:32 PM
I used the "hide" feature on 3 columns - now I cannot get them b. Patinak New Users to Excel 6 March 12th 05 06:18 PM
How do I automatically hide columns in a worksheet based on a cell value? dkhedkar Excel Worksheet Functions 1 March 5th 05 12:20 AM
Hide Cell Content if no data in previous columns Sherry Excel Discussion (Misc queries) 4 February 21st 05 07:27 PM
drop down list multiple columns c Excel Discussion (Misc queries) 9 January 27th 05 03:13 PM


All times are GMT +1. The time now is 02:58 AM.

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"