Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If i have a cell with a comment in it and that comment has say 4 lines :
one two three four I know I can refer to a single line by using Range(CurrAddress).Comment.text, vbLf)(2) which would refer to "Three" But what if i want to replace the "three" with "someting else"? Range(CurrAddress).Comment.text, vbLf)(2)="Something Else" doesn't work.... Thanks in advance Kevin Green |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I put your stuff in C8
Sub stitute() Dim r As Range, s As String Set r = Range("C8") s = r.Comment.Text pieces = Split(s, Chr(10)) pieces(2) = "something else" r.Comment.Text Text:=Join(pieces, Chr(10)) End Sub -- Gary''s Student - gsnu200830 "Kevin" wrote: If i have a cell with a comment in it and that comment has say 4 lines : one two three four I know I can refer to a single line by using Range(CurrAddress).Comment.text, vbLf)(2) which would refer to "Three" But what if i want to replace the "three" with "someting else"? Range(CurrAddress).Comment.text, vbLf)(2)="Something Else" doesn't work.... Thanks in advance Kevin Green |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
NICE!!! I like it.. I especially like your macro name!! :-)
Thank you much for the help.. "Gary''s Student" wrote: I put your stuff in C8 Sub stitute() Dim r As Range, s As String Set r = Range("C8") s = r.Comment.Text pieces = Split(s, Chr(10)) pieces(2) = "something else" r.Comment.Text Text:=Join(pieces, Chr(10)) End Sub -- Gary''s Student - gsnu200830 "Kevin" wrote: If i have a cell with a comment in it and that comment has say 4 lines : one two three four I know I can refer to a single line by using Range(CurrAddress).Comment.text, vbLf)(2) which would refer to "Three" But what if i want to replace the "three" with "someting else"? Range(CurrAddress).Comment.text, vbLf)(2)="Something Else" doesn't work.... Thanks in advance Kevin Green |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Very neat! -- mdmackillop ------------------------------------------------------------------------ mdmackillop's Profile: http://www.thecodecage.com/forumz/member.php?userid=113 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=57722 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find and Replace - Replace with Blank Space | Excel Discussion (Misc queries) | |||
How do I remove split a split window? | New Users to Excel | |||
find and replace - replace data in rows to separated by commas | Excel Worksheet Functions | |||
Using Find and Replace to replace " in a macro | Excel Programming | |||
Replace method - cannot find any data to replace | Excel Programming |