LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Create & Format XL Comments with VBA


XL2003

I'm trying to take the formatted text of a cell and put it into a
comment.

While it would be cool to format the colors, size and any other options
that goes with Edit Comment | Format Comment, I would be satisfied to
simply have the first line bold.

Example of Stock Codes:
Cell B1 = "*Local Stock:*
Parts are on-hand"
Cell B2 = "*Manufacturer Ship:*
Parts ordered are shipped
directly by Manufacturer" ... etc

I'm using SELECT CASE code to determine my stock code which in turns
points to the cell to be copied into the comment.

---------------
Select Case rcStr ' Evaluate Stock Code.
Case "A"
commentText = Index.Range("B1").Text
Case "B"...
commentText = Index.Range("B2").Text
Case "C"...etc
End Select

On Error Resume Next
ws.Cells(niinRow, 6).AddComment
With ws.Cells(niinRow, 6).Comment
..Visible = False
..Text Text:=commentText
..Shape.TextFrame.AutoSize = True
' code here to bold the first line, or
End With
' code here to bold the first line?
----------

So far, the code works fine in that it replicates the linebreaks as
entered on the source cells. I'm almost positive that I've seen an
example from somewhere a few years ago that handles formatting, but now
that I need it ...

I'm thinking this may involve using FIND, LEN and or LEFT to locate
where the first soft line break [Alt+Enter] and bold the string prior
to it. But I've got zilch from searching archives and experimenting in
this direction.

TIA


--
AH·C
------------------------------------------------------------------------
AH·C's Profile: http://www.excelforum.com/member.php...o&userid=29108
View this thread: http://www.excelforum.com/showthread...hreadid=496363

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2000 how to format the comments font all comments Delquestion Excel Discussion (Misc queries) 1 October 8th 09 02:19 PM
Create Comments Vinod[_2_] Excel Worksheet Functions 1 November 6th 07 12:27 PM
format for comments De Excel Discussion (Misc queries) 2 March 23rd 07 06:39 PM
Comments Format Help David Excel Worksheet Functions 0 January 16th 07 12:14 PM
Create Excel sheet in HTML with comments Luke Webber Excel Programming 2 October 7th 03 02:34 PM


All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"