使用函数
COLUMNS(colr(i) & ":" & colr(j))
Function CoLr(ColNumber As Integer) As String
'返回列数字的英文字母
On Error GoTo Errorhandler
CoLr = Split(Cells(1, ColNumber).Address, "$")(1)
Exit Function
Errorhandler:
MsgBox "Error encountered, please re-enter "
End Function
Range(Cells(1, i), Cells(1, j)).ColumnWidth
Sub a()
Dim i As Integer
Dim j As Integer
i = 1
j = 5
ActiveSheet.Columns(i).Resize(, j).columnwidth =6
End Sub