![]() |
|
#3
|
|||
|
|||
|
HI,
Try this code in the worksheet code module. When you double click in "A1" the code will hide all of the rows to the "1st" empty row. If you need to do this several time then you will need a different code. That's why I asked for file to look at. In the file indicate where you need the "Hide" action to take place. When you double click on range "A1" again it will unhide the rows. Code:
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim i As Long
i = Range("A1").End(xlDown).Row
If Target.Column = 1 Then
Cancel = True
If Range("A" & Target.Row + 1).Rows.Hidden Then
Range("A:A").Rows.Hidden = False
Else
Range("A" & Target.Row + 1 & ":A" & i + 1).Rows.Hidden = True
End If
End If
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hide/Unhide Text Based on Drop Down Selection | gw1500se | Word | 3 | 02-19-2015 12:17 PM |
Hide/Unhide a Block of Text Based on Choice Selection
|
inquirer | Word VBA | 7 | 09-22-2014 04:41 PM |
VBA Code Needed that will Hide / Unhide a row when used with a "Check Box"
|
barryoffshore | Excel Programming | 4 | 06-23-2014 05:07 AM |
| Hide/Unhide pictures | maloneb | PowerPoint | 1 | 01-18-2012 03:34 PM |
Unhide and Re-hide in Excel 2003
|
thorgal67 | Excel | 1 | 07-16-2009 07:06 AM |