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

[µo°Ý] ¤£µ¥©óªÅ¥ÕªºÀx¦s®æµe®Ø½u

[µo°Ý] ¤£µ¥©óªÅ¥ÕªºÀx¦s®æµe®Ø½u

  1.   Sub µe®Ø½u()

  2.     Columns("A:B").Select
  3.     Selection.FormatConditions.Delete
  4.     Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlNotEqual, _
  5.         Formula1:="="""""
  6.     With Selection.FormatConditions(1).Borders(xlLeft)
  7.         .LineStyle = xlContinuous
  8.         .Weight = xlThin
  9.         .ColorIndex = xlAutomatic
  10.     End With
  11.     With Selection.FormatConditions(1).Borders(xlRight)
  12.         .LineStyle = xlContinuous
  13.         .Weight = xlThin
  14.         .ColorIndex = xlAutomatic
  15.     End With
  16.     With Selection.FormatConditions(1).Borders(xlTop)
  17.         .LineStyle = xlContinuous
  18.         .Weight = xlThin
  19.         .ColorIndex = xlAutomatic
  20.     End With
  21.     With Selection.FormatConditions(1).Borders(xlBottom)
  22.         .LineStyle = xlContinuous
  23.         .Weight = xlThin
  24.         .ColorIndex = xlAutomatic
  25.     End With
  26. End Sub
½Æ»s¥N½X
¦U¦ì¤j¤j:
§Ú¤~­è¾ÇVBA¿ý»s¡A½Ð¤j®a¤£§[«ü¾É¡C·P®¦!
½Ð°Ý:
¤W­±ªº"A.B¤GÄ椣µ¥©óªÅ¥ÕªºÀx¦s®æµe®Ø½u"µ{¦¡½X­n¦p¦ó²¤Æ?
©Î¬O
¤@¯ëªºµ{¦¡½X­n¦p¦ó¼¶¼g?
ÁÂÁÂ!

¦^´_ 7# naruto018
¤w§ä¨ìµª®×¤F!ÁÂÁ±z^^

    Sub ¦³­ÈÀx¦s®æµe®Ø½u()

               For Each a In Range("A:B")  'A,BÄ榳­ÈÀx¦s®æµe®Ø½u
                 If a <> "" Then a.Borders.LineStyle = xlContinuous
               Next
    End Sub

TOP

¦^´_ 7# naruto018
¤£¦n·N«ä¡A¯à¤£¯à±Ð§Ú¥ÎFor...Next
±N <>""ªºÀx¦s®æµe®Ø½u¡C
ÁÂÁ±z!

TOP

¥»©«³Ì«á¥Ñ papaya ©ó 2017-10-28 13:19 ½s¿è

¦^´_ 7# naruto018
µ{¦¡½X²¤Æ³\¦h¤F!
·PÁ±z­@¤ßªº¥[µù¸Ñ©M«ü¾É!
±z´£¨Ñªº¸ê°T«Ü¹ê¥Î¡AÁÂÁ±z^_^

TOP

¦^´_ 5# papaya


    ¥[µù¸Ñ
  1. Sub µe®Ø½u3()

  2.     Columns("A:B").FormatConditions.Delete '§R°£A.BÄæ®æ¦¡¤Æ±ø¥ó
  3.     With Columns("A:B").FormatConditions.Add(Type:=xlCellValue, Operator:=xlNotEqual, _
  4.         Formula1:="=""""") '¦bA.BÄæ·s¼W¤@­Ó®æ¦¡¤Æ±ø¥ó¡A±ø¥ó¬°Àx¦s®æ¤£¬°ªÅ¥Õ
  5.         .Borders.LineStyle = xlContinuous '³]©w®æ¦¡¤Æ±ø¥óªº¥~®Ø®æ¦¡
  6.     End With
  7. End Sub
½Æ»s¥N½X

TOP

¦^´_ 5# papaya

°Ñ¦Ò¬Ý¬Ý
  1. Sub µe®Ø½u3()

  2.     Columns("A:B").FormatConditions.Delete
  3.     With Columns("A:B").FormatConditions.Add(Type:=xlCellValue, Operator:=xlNotEqual, _
  4.         Formula1:="=""""")
  5.         .Borders.LineStyle = xlContinuous
  6.     End With
  7. End Sub
½Æ»s¥N½X
·j´M¥\¯à¥i¥H¦h§Q¥ÎGoogle·j´M
·j´M¯S©wºô¯¸
ÃöÁä¦r+site:ºô¯¸ºô§}

TOP

¦^´_ 3# naruto018
ªþ¤W»Ý¨Dªº¹Ï¤ù:

TOP

¦^´_ 3# naruto018
¤£¦n·N«ä¡AªGµM¬O§Úªºµo°Ý¤£°÷·Ç½T¡C

­ì¥»§Ú¬O¿ý»sA,B¤GÄæµe®Ø½u¡A¿ý»s¥X¨Óªºµ{¦¡½X¤@¤j°ï¡F
ª¦¤å«á¡A«o¨£¨ì¥u­n¤@¦Cµ{¦¡½X´N¥i¥H¹F¨ì¥Øªº
  Sub µe®Ø½u()
Range("A:B").Borders.LineStyle = xlContinuous
End Sub
©Î
Sub µe®Ø½u()
Columns("A:B").Borders.LineStyle = xlContinuous
End Sub

©Ò¥H¡A½Ð°Ý¤j¤j:
¥u­n±NA,B¤GÄ椣¬OªÅ¥ÕªºÀx¦s®æµe®Ø½u¡A
¤W­±ªºµ{¦¡½X­n«ç»ò¦A½s¿è?
ÁÂÁ±z!

TOP

¦^´_ 2# papaya


    °Ñ¦Ò¬Ý¬Ý
  1.   Sub µe®Ø½u2()

  2.     Columns("A:B").FormatConditions.Delete
  3.     With Columns("A:B").FormatConditions.Add(Type:=xlCellValue, Operator:=xlNotEqual, _
  4.         Formula1:="=""""")
  5.         With .Borders(xlLeft)
  6.             .LineStyle = xlContinuous
  7.             .Weight = xlThin
  8.             .ColorIndex = xlAutomatic
  9.         End With
  10.         With .Borders(xlRight)
  11.             .LineStyle = xlContinuous
  12.             .Weight = xlThin
  13.             .ColorIndex = xlAutomatic
  14.         End With
  15.         With .Borders(xlTop)
  16.             .LineStyle = xlContinuous
  17.             .Weight = xlThin
  18.             .ColorIndex = xlAutomatic
  19.         End With
  20.         With .Borders(xlBottom)
  21.             .LineStyle = xlContinuous
  22.             .Weight = xlThin
  23.             .ColorIndex = xlAutomatic
  24.         End With
  25.     End With
  26. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ papaya ©ó 2017-10-25 14:58 ½s¿è

¬O§Úªº»¡©ú¤£²M·¡?ÁÙ¬O¿ý»sªºµ{¦¡½X¤£¯à¦A²¤Æ?

"¤p¾Ç¥Í"¨S¦³·j¯ÁªºÅv¤O¡A¤£¶È¬Oªì¾Ç²ßªÌªº»Ùê¡A¤]¬O¼W¥[½×¾Â®e¶q­t¾áªº­ì¦]¤§¡C
°²¦p¯àÅý"¤p¾Ç¥Í"¦³·j¯Á¤w¸Ñ¨MÃDªºÅv¤O¡A
¥i¯à¤@¯ëªº°ò¥»°ÝÃD¡A´N¥i¥HÂÇ·j¯Á§ä¨ìµª®×¡A¥H´î»´½×¾Âªº®e¶q­t¸ü¡C

TOP

        ÀR«ä¦Û¦b : ¨C¤ÑµL©Ò¨Æ¨Æ¡A¬O¤H¥Íªº®ø¶OªÌ¡A¿n·¥¡B¦³¥Î¤~¬O¤H¥Íªº³Ð³yªÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD