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

[Âà¶K] Comment - §PÂ_/¦s¨ú/¾Þ±±Àx¦s®æµù¸Ñ

[Âà¶K] Comment - §PÂ_/¦s¨ú/¾Þ±±Àx¦s®æµù¸Ñ

¦s¨úÀx¦s®æµù¸Ñ¦³ NoteText ¤èªk¤Î¨Ï¥Î Comment ª«¥ó¨âºØ¤è¦¡¡CNoteText¬O¨Ó¦Ûª©¥»ªº¤èªk¡A²{¤w¥Ñ Comment ª«¥ó©Ò¨ú¥N¡CNoteText¤èªk¾A¥Î²©öªº¦s¨ú¡A¦pªG·Q¹ïµù¸Ñ°µ§ó¦h¼Ë¤Æªº±±¨î¡A½Ð¨Ï¥Î Comment ª«¥ó¡C

§PÂ_¥Ø«eÀx¦s®æ¬O§_¦³µù¸Ñ
¦pªG¹ï¤@­Ó¤£§tµù¸ÑªºÀx¦s®æ¶i¦æµù¸Ñªº¬ÛÃö¾Þ§@¡A·|µo¥Í¿ù»~¡C
¥i¥ý§Q¥Î¥H¤U¤è¦¡§PÂ_¦³µLµù¸Ñ --
Sub detect_Comment()
¡@If ActiveCell.Comment Is Nothing Then
¡@¡@'¨S¦³µù¸Ñ
¡@Else
¡@¡@'§t¦³µù¸Ñ
¡@End If
¡@'¤Ï¹L¨Ó»¡´N¬O
¡@If Not ActiveCell.Comment Is Nothing Then
¡@¡@'§t¦³µù¸Ñ
¡@End If
End Sub

PS. ¥H¤Uªº¥N½X¬Ý¦ü¥i¥H§PÂ_Àx¦s®æ¨S¦³µù¸Ñ --
IF ActiveCell.NoteText = "" Then ...
¨ä¹ê³o­Ó§PÂ_¦¡¦b "µù¸Ñ¬°ªÅ¥Õ" ©M "¨S¦³µù¸Ñ" ¨âºØ±¡§Î¤U³£·|¦¨¥ß¡A¨Ã¤£¯àºë½Tªº§PÂ_¡C¦]¦¹ÁÙ¬O«Øij§Q¥Î Comment ª«¥ó¸û²z·Q¡A¦p¤W­±ªº¨Ò¤l¡C

¬°Àx¦s®æ¥[¤Wµù¸Ñ / ²¾°£µù¸Ñ
ActiveCell.AddComment
ActiveCell.Comment.Text "xxx"
©Î
ActiveCell.AddComment.Text "xxx"

²¾°£µù¸Ñ
ActiveCell.Comment.Delete

NoteText»¡¡G¤Ñ¥Í§Ú§÷¥²¦³¥Î¡C
NoteTextÁÙ¬O¦³¥¦ªº¦n³B¡A¥H¤U½d¨Ò¬O§PÂ_©Ò¦³¤½¦¡Àx¦s®æ¦³µLµù¸Ñ¡AµL«h¥[¤W¡A¦³«h§R°£¡C¦Ó NoteText ²¤Æ¤F¥[¤W/²¾°£µù¸Ñªº¥N½X¡C
Sub SwitchComments( )
¡@For Each c In Cells.SpecialCells(xlCellTypeformulas)
¡@¡@If c.Comment Is Nothing Then
¡@¡@¡@ c.NoteText c.Formula
¡@¡@Else
¡@¡@¡@ c.NoteText ""
¡@¡@End If
¡@¡@'¥i¥H¦A²¤Æ¦¨¤@¦æ¥N½X
¡@¡@c.NoteText IIf(c.Comment Is Nothing, c.Formula, "")
¡@Next
End Sub

--------------------------------------------------------------------------------

µù¸ÑÀ³¥Î½d¨Ò¡G¶K¤Wµù¸Ñ (¨Ã³]©wµù¸Ñ®æ¦¡)
Sub Macro1()
¡@¡@Dim cmt As Comment, data As New DataObject
¡@¡@Set cmt = ActiveCell.Comment
¡@¡@data.GetFromClipboard '¨ú±o°Å¶K鷺®e
¡@¡@If cmt Is Nothing Then
¡@¡@¡@¡@ActiveCell.AddComment
¡@¡@¡@¡@Set cmt = ActiveCell.Comment
¡@¡@¡@¡@cmt.Text data.GetText(1) '³]©wµù¸Ñ¤º®e
¡@¡@¡@¡@With cmt.Shape.TextFrame '³]©wµù¸Ñ®æ¦¡
¡@¡@¡@¡@¡@¡@.Characters.Font.FontStyle = "¼Ð·Ç"
¡@¡@¡@¡@¡@¡@.AutoSize = True
¡@¡@¡@¡@End With
¡@¡@Else '­Yµù¸Ñ¤w¦s¦b«h²K¥[©ó­ìµù¸Ñ¤§«á
¡@¡@¡@¡@cmt.Text cmt.Text & vbLf & data.GetText(1)
¡@¡@End If
End Sub

PS. ¥»¨Ò¦]¥Î¨ì DataObject¡A»Ý¤Þ¥Î Microsoft Form 2.0 Object ¶µ¥Ø¡C
½Ð°Ñ¦Ò¬ÛÃö¥DÃD - Clipboard: ¦s¨ú°Å¶Kï

¦^´_ 2# PD961A


    ³o¬Oexcel°Q½×°Ï
¤£°Q½×excel¥Î¨ìªºªF¦è­n°Q½×¬Æ»ò?
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : §ïÅܦۤv¬O¦Û±Ï¡A¼vÅT§O¤H¬O±Ï¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD