Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have sr. no, name, address, address2, address3, and city columns. By default I want address, address2, address3, and city column hidden. When I enter more than 3 character in name colums automatically all hidden columns should be view or unhide. THANKS, jgp |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
jgp,
Copy and paste the below code in the sheet where you are having those columns. ------ Code Begins Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 2 Then If Len(Target.Value) 3 Then For I = 3 To 6 Cells(, I).EntireColumn.Hidden = False Next I End If End If End Sub ------ Code Ends Also paste the below code in the ThisWorkbook event. ------ Code Begins Private Sub Workbook_Open() For I = 3 To 6 Sheet1.Cells(, I).EntireColumn.Hidden = True Next I End Sub ------ Code Ends Revert to me, if you've any probs in this. -- Regards, Sriram Subramaniyan "jgp" wrote: I have sr. no, name, address, address2, address3, and city columns. By default I want address, address2, address3, and city column hidden. When I enter more than 3 character in name colums automatically all hidden columns should be view or unhide. THANKS, jgp |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So if you have 2 character names in rows 1-10, and then you enter a 3 char
name, you want those columns unhidden, which will show them for the other rows as well? -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "jgp" wrote in message ... I have sr. no, name, address, address2, address3, and city columns. By default I want address, address2, address3, and city column hidden. When I enter more than 3 character in name colums automatically all hidden columns should be view or unhide. THANKS, jgp |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi jgp,
You can do that trough Userform control that more easy to use and understand. Try this : Private Sub TextBox1_KeyDown(ByVal KeyCode As _ MSForms.ReturnInteger, ByVal Shift As Integer) If Len(TextBox1.Value) = 2 Then Columns("B:E").Hidden = False Else Columns("B:E").Hidden = True End If End Sub Rgds, Halim jgp menuliskan: I have sr. no, name, address, address2, address3, and city columns. By default I want address, address2, address3, and city column hidden. When I enter more than 3 character in name colums automatically all hidden columns should be view or unhide. THANKS, jgp |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hide Column If Usedrange of Column ISBLANK Follow-up | Excel Discussion (Misc queries) | |||
Hide Column If Usedrange of Column ISBLANK | Excel Discussion (Misc queries) | |||
UN-hide column A???? | Excel Discussion (Misc queries) | |||
Hide column or row based on a cell in the column or row? | Excel Discussion (Misc queries) | |||
How to hide a column when value=1 | Excel Programming |