- ©«¤l
- 913
- ¥DÃD
- 150
- ºëµØ
- 0
- ¿n¤À
- 1089
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- office 2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2011-8-28
- ³Ì«áµn¿ý
- 2023-7-19
|
Dear¤j¤j,
½Ð«ü¾É µ{¦¡2
¥¦¥i¥H¼W¥[ªÅ¥Õµù¸Ñ,¦ýµLªk±NWorkbooks("³Ì·s®w¦sB.xlsx").Sheets("¸¤ñ")ªº¼t¯Êȸü¤Jµù¸Ñ¤¤,
¦Ó¥B¸ü¤Jªºµù¸ÑµLªk¨Ì Sheets("¸¤ñ")ªº¼t¯ÊȦì¸m¸ü¤J,µù¸Ñ¶ñº¡¤F ¤ë®w¦sªí.xlsx Range("J4:Y")
¥B§Æ±æµù¸Ñªº®Ø®Ø¤j¤p,¥i¥H¨Ìµù¸Ñ¤º®e¦Û°Ê¤j¤p,¥Ø«eªº¤Ó¤j¤F.- Sub ¼t¯Êµù¸Ñ()
- Dim PH$, FN$, rng As Range, xb As Workbook, Sh As Worksheet, i As String
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False '¤@¯ë´£Äµ¥Ü°T®§Ãö³¬
- Application.Calculation = xlManual '¤â°Êpºâ
- i = Format(Date, "D")
- FN = "¤ë®w¦sªí.xlsx" '¥ØªºÀÉ
- PH = "T:\0_¦Ûqªí³æ\¨ä¥Lªí³æ\¥¤é®wªí\" '¥Øªº
- On Error Resume Next: Set xb = Workbooks(FN): On Error GoTo 0 'ÀˬdÀɮ׬O§_¤w¶}±Ò(ÁקK·í¾÷)
- If xb Is Nothing Then Set xb = Workbooks.Open(PH & FN) '¥ØªºY¥¼¶}±Ò,«h¶}±Ò¤§
- Set Sh = Workbooks("³Ì·s®w¦sB.xlsx").Sheets("¸¤ñ")
- With Sh
- xRow = Cells(Cells.Rows.Count, "F").End(xlUp).Row
- Set sRng = Range("BJ4:BY" & xRow) '¨Ó·½:¼t¯Ê½d³ò
- End With
- With xb.Sheets(i)
- xb.Sheets(i).Activate
- xRow = Cells(Cells.Rows.Count, "E").End(xlUp).Row
- For Each rng In Range("J4:Y" & xRow) 'n¼g¤Jªº½d³ò,¥Øªºq³æ½d³ò
- On Error Resume Next
- If sRng <> "" Then 'Àx¦s®æªºÈ¤£¬° ªÅ¥Õ
- Set cmt = rng.Addcomment '±NÀx¦s®æªºÈ¼g¤Jµù¸Ñ¤¤
- cmt.Text "¼t¯Ê*" & sRng.Value
- With rng.Comment.Shape.TextFrame.Characters.Font
- .AutoSize = True
- .Name = "²Ó©úÅé"
- .Size = 10
- End With
- End If
- Next rng
- End With
- Application.ScreenUpdating = True '¥´¶}«Ì¹õ§ó·s
- End Sub
½Æ»s¥N½X |
|