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

[Âà¶K] VBAªº¼g§@§Þ¥©»P¼W¶i®Ä¯à

±q¦¹¤å³¹¾Ç¨ìºëµØ¡A³o¨Ç²¤Æ¤è¦¡¦b¦U¥ý¶i´£¨Ñ¸Ñµª¤¤
³£¥i¥H¾Ç¨ì¡A¸g¥Ñ¦¹½g§óºëµØ§l¦¬¡A·P®¦
Á`¬O§Q¥Î¥¨¶°¿ý»s¡A¦A¨Ì¾Ç²ß¨ìªºVBA»yªk
·Q·Q«ç»ò²¤Æ¡A¨Ó¨ì³o¬Ý¬Ý¨ä¥L¤Hªº¼gªk
¦A¬Ý¬Ý¥H«e¼gªº¡AÁ`¬O¥i¥H¾Ç¨ì¤@¨Ç
¹³¬O³æ¯Â²{¦s¼Æ¾Ú¡A¥H«eÁ`¬O¥Ç¤F¿ï¨úcells
¦A³B²z¡Aªñ¤é¾Ç¨ì¤@¨Ç¡A°w¹ï§Q¥Î³B²z¼Æ¾Ú
¼g¤F¤@¬q³B²z®æ¦¡ªº»yªk
¥Ø«e³B²z¸ê®Æ©|¥i¡A¦ý¤@ª½«ùÄò¾Ç²ß²¤Æ¼W¶i®Ä¯à§Þ¥©¤¤
Ãö©óApplication.ScreenUpdating ¾Ç¨ì¡A¥¿¦b¹B¥Î²¤Æ¤¤
¥Ø«e¥¿¦b¾Ç²ß¦p¦ó²¤Æ¡A¦pªG¦³Â²¤Æidea ·Ð½Ð´£¨Ñ¨Ñ¾Ç²ß¡A·P®¦

KRowEnd = Cells(Rows.Count, 1).End(xlUp).Row '¥H AÄæ¸ê®Æ¬°°ò¦ =1 §PÂ_½d³ò
kcolend = Cells(1, Columns.Count).End(xlToLeft).Column '¥H ²Ä¤@¦C¸ê®Æ¬°°ò¦ =1§PÂ_§PÂ_½d³ò

MsgBox "¦C¼ÆKRowEnd=" & KRowEnd
MsgBox "Äæ¼Ækcolend=" & kcolend

Range(Cells(1, 1), Cells(1, kcolend)).Select

    With Selection.Interior
        .ColorIndex = 36 '²L¶À¦â
        .Pattern = xlSolid
    End With
    Selection.Font.ColorIndex = 3


Range(Cells(2, 1), Cells(KRowEnd, kcolend)).Select

    ActiveWindow.FreezePanes = True
    Selection.FormatConditions.Delete
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
        "=MOD(ROW(),2)"
    Selection.FormatConditions(1).Interior.ColorIndex = 15
Range(Cells(1, 1), Cells(1, kcolend)).Select
    Selection.AutoFilter
    Cells.EntireColumn.AutoFit

TOP

        ÀR«ä¦Û¦b : ªY½à§O¤H´N¬O²øÄY¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD