Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Carriage return in comment not working

Hi
I am trying to add a comment to a subtotal showing what is included. The macro goes through a loop, adding to the comment string

runningmessage = "The following tiers are included in this subtotal:" + vbC
runningmessage = runningmessage + subtotmessage(counters) + vbC

But after the adding the comment, the data displays horizontally instead of showing the carriage return. This is the code for the comment addition

'Commen
Cells(8, checker + 5).AddCommen
Cells(8, checker + 5).Comment.Visible = Fals
Cells(8, checker + 5).Comment.Shape.TextFrame.AutoSize = Tru
Cells(8, checker + 5).Comment.Text Text:=runningmessag

Thanks for any help you can give me

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Carriage return in comment not working

Try vbLf?

"dumbass" wrote in message
...
Hi-
I am trying to add a comment to a subtotal showing what is included. The

macro goes through a loop, adding to the comment string:

runningmessage = "The following tiers are included in this subtotal:" +

vbCr
runningmessage = runningmessage + subtotmessage(counters) + vbCr

But after the adding the comment, the data displays horizontally instead

of showing the carriage return. This is the code for the comment addition:

'Comment
Cells(8, checker + 5).AddComment
Cells(8, checker + 5).Comment.Visible = False
Cells(8, checker + 5).Comment.Shape.TextFrame.AutoSize = True
Cells(8, checker + 5).Comment.Text Text:=runningmessage

Thanks for any help you can give me!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Carriage return in comment not working

Hi,

Try replacing the constant vbCR with vbLF

Cheers
Andy

dumbass wrote:

Hi-
I am trying to add a comment to a subtotal showing what is included. The macro goes through a loop, adding to the comment string:

runningmessage = "The following tiers are included in this subtotal:" + vbCr
runningmessage = runningmessage + subtotmessage(counters) + vbCr

But after the adding the comment, the data displays horizontally instead of showing the carriage return. This is the code for the comment addition:

'Comment
Cells(8, checker + 5).AddComment
Cells(8, checker + 5).Comment.Visible = False
Cells(8, checker + 5).Comment.Shape.TextFrame.AutoSize = True
Cells(8, checker + 5).Comment.Text Text:=runningmessage

Thanks for any help you can give me!


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Carriage return in comment not working

Replace "+" with "&"
vbCR with CHR(10)

runningmessage = "The following tiers are included in this subtotal:" &
CHR(10) runningmessage = runningmessage + subtotmessage(counters) & CHR(10)

hth
--

steveB

(Remove 'NOSPAM' from email address if contacting me direct)


"dumbass" wrote in message
...
Hi-
I am trying to add a comment to a subtotal showing what is included. The

macro goes through a loop, adding to the comment string:

runningmessage = "The following tiers are included in this subtotal:" +

vbCr
runningmessage = runningmessage + subtotmessage(counters) + vbCr

But after the adding the comment, the data displays horizontally instead

of showing the carriage return. This is the code for the comment addition:

'Comment
Cells(8, checker + 5).AddComment
Cells(8, checker + 5).Comment.Visible = False
Cells(8, checker + 5).Comment.Shape.TextFrame.AutoSize = True
Cells(8, checker + 5).Comment.Text Text:=runningmessage

Thanks for any help you can give me!



Reply
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
Carriage return CWH Excel Discussion (Misc queries) 1 March 16th 10 01:54 PM
program carriage return MarkM[_2_] Excel Discussion (Misc queries) 3 January 23rd 08 02:36 PM
Carriage Return Freddo Excel Worksheet Functions 2 March 22nd 07 10:34 AM
carriage return code Rusty Setting up and Configuration of Excel 1 February 14th 06 03:03 AM
Carriage Return Tom Ogilvy Excel Programming 3 August 20th 03 07:22 PM


All times are GMT +1. The time now is 09:28 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"