ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð±Ð¦U¦ì«e½ú,¦p¦ó²¤Æµ{¦¡,·P®¦.

[µo°Ý] ½Ð±Ð¦U¦ì«e½ú,¦p¦ó²¤Æµ{¦¡,·P®¦.

Dim objCol As Object
    i = 1
Set objCol = Union(Columns(i), Columns(i + 4), Columns(i + 8), Columns(i + 12), Columns(i + 16)) '²Ä1,5,9,13Äæ
    objCol.Select
    objCol.ColumnWidth = 8.13  'Äæ¦ì¼e«×   
    '=============================
    j = 2   
    Set objCol = Union(Columns(j), Columns(j + 4), Columns(j + 8), Columns(j + 12), Columns(j + 16)) '²Ä2,6,10,14Äæ
    objCol.Select
    objCol.ColumnWidth = 15.3
    '=============================
    k = 3
    Set objCol = Union(Columns(k), Columns(k + 4), Columns(k + 8), Columns(k + 12), Columns(k + 16)) '²Ä3,7,11,15Äæ
    objCol.Select
    objCol.ColumnWidth = 20.13
     '=============================
    l = 4   
    Set objCol = Union(Columns(l), Columns(l + 4), Columns(l + 8), Columns(l + 12), Columns(l + 16))  '²Ä4,8,12,16Äæ
    objCol.Select
    objCol.ColumnWidth = 5.13
    '---------------------------------------------------
§ù¤p¥­

¥»©«³Ì«á¥Ñ quickfixer ©ó 2021-4-28 13:39 ½s¿è

¦^´_ 1# dou10801

Sub test()
    For i = 1 To 4
        Union(Columns(i), Columns(i + 4), Columns(i + 8), Columns(i + 12), Columns(i + 16)).ColumnWidth = Choose(i, 8.13, 15.3, 20.13, 5.13)
    Next i
End Sub
1

µû¤À¤H¼Æ

    • ML089: ¨Ï¥Î Choose ²¤Æ¡AÆgª÷¿ú + 2

TOP

¦^´_ 1# dou10801

Sub ex1()
    Range("A1,E1,I1,M1,Q1").Offset(, 0).ColumnWidth = 8.13
    Range("A1,E1,I1,M1,Q1").Offset(, 1).ColumnWidth = 15.3
    Range("A1,E1,I1,M1,Q1").Offset(, 2).ColumnWidth = 20.13
    Range("A1,E1,I1,M1,Q1").Offset(, 3).ColumnWidth = 5.13
End Sub
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¨âºØ«äºû¼Ò¦¡,¦]­ìÀɸê®Æ23000µ§,·|¥Î¤ß¾Ç²ß´ú¸Õ.
§ù¤p¥­

TOP

        ÀR«ä¦Û¦b : ¤H­n¦Û·R¡A¤~¯à·R´¶¤Ñ¤Uªº¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD