problem selecting entire column

M

mark kubicki

once again, i'm having a problem selecting an entire column(s):
the following code consistently selects more columns than i want:


Columns("E:R").Select
With Selection
.columnwidth = 10.25
.EntireColumn.Hidden = False
End With
Columns("S:T").Select
With Selection
.EntireColumn.Hidden = True
End With
Columns("U:U").Select
With Selection
.columnwidth = 13
End With

as always, thanks in advance
mark
 
K

Ken Wright

No need to select at all:-

Sub Cols()

With Columns("E:R")
.ColumnWidth = 10.25
.EntireColumn.Hidden = False
End With

With Columns("S:T")
.EntireColumn.Hidden = True
End With

With Columns("U:U")
.ColumnWidth = 13
End With

End Sub

or

Sub Cols()

With Columns("E:R")
.ColumnWidth = 10.25
.EntireColumn.Hidden = False
End With

Columns("S:T").EntireColumn.Hidden = True
Columns("U:U").ColumnWidth = 13

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