PDA

View Full Version : Solved: Dealing with multiple columns with variables



GreenTree
04-14-2007, 06:35 PM
If I want to change a width on columns B thru E, I can do something like this: With Columns("B:E")
.ColumnWidth = 4
' etc
End with

Ok, but what if I want to specify with variables the columns that I want to work with? Suppose I want to do a continuous range from FirstCol to LastCol, how would I do the above code with variables, please?

Thanks for the help!

GT

Bob Phillips
04-15-2007, 01:57 AM
Columns(FirstCol).Resize(, LastCol - FirstCol + 1).ColumnWidth = 25

GreenTree
04-15-2007, 03:32 PM
Many thanks!