Macro to reveal three hidden rows each time it's clicked

R

Rodney

Hi guys ,

Is it possible to create a macro which will reveal the next three hidden
rows in excel every time a user clicks it? I've got a lot of hidden rows but
I only want the next three to be displayed each time a user clicks the same
button to activate the macro. I'd also like the cursor to then be placed in
the first cell of the next three rows. Can you help?

Many thanks,
Keith
 
D

Don Guillett

Right click sheet tab>view code>insert this. Then DOUBLE click to fire

Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Range, Cancel As Boolean)
For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If Rows(i).Hidden = True Then
Rows(i).Resize(3).Hidden = False
Cells(i, 1).Select
Exit For
End If
Next i
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top