Can I expand & shrink columns?

Y

youngsequan

Hello everyone,

I want to know it there is a way to pick 2 or 4 columns and have them expand
when I click on them.

So I want it where I can click on them and they expand to normal size and if
I click on them again the columns will shrink back to a smaller size.

I hope I'm making sense.

I don't want to have to widened the column by clicking in between each
column, I know how to do that.

I'm trying to create sort of a daily planner, so I want it to where the days
I'm not looking at are like shrunk to a smaller size
 
D

Don Guillett

Right click sheet tab>view code>insert this.Modify to suit
Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, Columns("D:F")) Is Nothing Then Exit Sub
tc = Target.Column
If Columns(tc).ColumnWidth <> 15 Then
Columns(tc).ColumnWidth = 15
Else
Columns(tc).ColumnWidth = 5
End If
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