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

[µo°Ý] ¦Û°Ê¶}±Ò«ü©wªºÀɮשM¼Ð¥Ü©³¦â¡C

¦^´_ 1# ziv976688
¤j·§¬O³o¼Ë§a~~
  1. Sub ¦Û°Ê¶ñ¦â_Click()
  2.     Application.ScreenUpdating = False
  3.    
  4.     Dim databook As Workbook
  5.     Path = ThisWorkbook.Path 'Àɮ׸ô®|
  6.     Filename = Sheets(1).Range("A1").Value '«ü©w¦WºÙ
  7.     Set databook = Workbooks.Open(Path & "\" & Filename) '¶}±ÒÀÉ®×
  8.     With databook.Sheets(1)
  9.         .Range("BA3:BF12").Interior.ColorIndex = 15
  10.         .Range("BA15:BF24").Interior.ColorIndex = 15
  11.         .Range("BA27:BF36").Interior.ColorIndex = 15
  12.         .Range("BA39:BF48").Interior.ColorIndex = 15
  13.         .Range("BA51:BF60").Interior.ColorIndex = 15
  14.         .Range("BA63:BF72").Interior.ColorIndex = 15
  15.         .Range("BA75:BF84").Interior.ColorIndex = 15
  16.     End With
  17.     With databook.Sheets(2)
  18.         .Range("BA3:BF12").Interior.ColorIndex = 15
  19.         .Range("BA15:BF24").Interior.ColorIndex = 15
  20.         .Range("BA27:BF36").Interior.ColorIndex = 15
  21.         .Range("BA39:BF48").Interior.ColorIndex = 15
  22.         .Range("BA51:BF60").Interior.ColorIndex = 15
  23.         .Range("BA63:BF72").Interior.ColorIndex = 15
  24.         .Range("BA75:BF84").Interior.ColorIndex = 15
  25.     End With
  26.     databook.Save  'Àx¦s
  27.     databook.Close  'Ãö³¬
  28.     Application.ScreenUpdating = True
  29. End Sub
½Æ»s¥N½X

TOP

¦^´_ 3# ziv976688
§Ú¥u«ü©w"A1"Àx¦s®æ¬°ÀɦW
¦]¬°§Ú¤£ª¾¹D§A­n±q­þ¸Ì³]©w§A­nÅܧóÀɮתºÀɦW

TOP

¦^´_ 3# ziv976688
¥[­Ó°j°é§a
  1. Sub ¦Û°Ê¶ñ¦â_Click()
  2.     Application.ScreenUpdating = False
  3.    
  4.     Dim databook As Workbook
  5.     Path = ThisWorkbook.Path 'Àɮ׸ô®|
  6.    
  7.     For i = 1 To Sheets(1).Range("A300").End(xlUp).Row
  8.     Filename = Cells(i, "A").Value 'ÀɦW
  9.     Set databook = Workbooks.Open(Path & "\" & Filename) '¶}±ÒÀÉ®×
  10.     With databook.Sheets(1)
  11.         .Range("BA3:BF12").Interior.ColorIndex = 15
  12.         .Range("BA15:BF24").Interior.ColorIndex = 15
  13.         .Range("BA27:BF36").Interior.ColorIndex = 15
  14.         .Range("BA39:BF48").Interior.ColorIndex = 15
  15.         .Range("BA51:BF60").Interior.ColorIndex = 15
  16.         .Range("BA63:BF72").Interior.ColorIndex = 15
  17.         .Range("BA75:BF84").Interior.ColorIndex = 15
  18.     End With
  19.     With databook.Sheets(2)
  20.         .Range("BA3:BF12").Interior.ColorIndex = 15
  21.         .Range("BA15:BF24").Interior.ColorIndex = 15
  22.         .Range("BA27:BF36").Interior.ColorIndex = 15
  23.         .Range("BA39:BF48").Interior.ColorIndex = 15
  24.         .Range("BA51:BF60").Interior.ColorIndex = 15
  25.         .Range("BA63:BF72").Interior.ColorIndex = 15
  26.         .Range("BA75:BF84").Interior.ColorIndex = 15
  27.     End With
  28.     databook.Save  'Àx¦s
  29.     databook.Close  'Ãö³¬
  30.     Next
  31.    
  32.     Application.ScreenUpdating = True
  33. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : µoµÊ®ð¬Oµu¼ÈªºµoºÆ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD