PC Review


Reply
Thread Tools Rate Thread

combining content from an input box with existing cell content

 
 
Colin Hayes
Guest
Posts: n/a
 
      25th Jul 2010


HI all

I'm struggling for syntax. I need to marry a variable with existing text
references.

I want to use the text I enter to an input box to replace the "<Monday>
" part of the code below.

ActiveCell.FormulaR1C1 = "=""<Monday> ""&RC[2]"


I'm setting up the input box this way :

openingtext = InputBox("Enter New Text")

and having entered my new text , I need to fit the variable openingtext
into the code above.

Can someone advise?

Grateful for any help.
 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      25th Jul 2010

I think they are supposed to be a struggle. <g>...

openingtext = "<" & openingtext & "> "
ActiveCell.FormulaR1C1 = "=""" & openingtext & """&RC[2]"

-OR-

openingtext = "<" & openingtext & "> "
ActiveCell.Value = "=" & Chr$(34) & openingtext & Chr$(34) & "&RC[2]"
--
Jim Cone
Portland, Oregon USA
Review of Special Sort add-in at... http://www.contextures.com/excel-sort-addin.html

..
..
..

"Colin Hayes" <(E-Mail Removed)>
wrote in message
news:(E-Mail Removed)...
HI all
I'm struggling for syntax. I need to marry a variable with existing text
references.
I want to use the text I enter to an input box to replace the "<Monday>
" part of the code below.

ActiveCell.FormulaR1C1 = "=""<Monday> ""&RC[2]"

I'm setting up the input box this way :
openingtext = InputBox("Enter New Text")
and having entered my new text , I need to fit the variable openingtext
into the code above.
Can someone advise?
Grateful for any help.
 
Reply With Quote
 
Colin Hayes
Guest
Posts: n/a
 
      25th Jul 2010
In article <i2g774$rb6$(E-Mail Removed)>, Jim Cone
<(E-Mail Removed)> writes
>
>I think they are supposed to be a struggle. <g>...
>
>openingtext = "<" & openingtext & "> "
>ActiveCell.FormulaR1C1 = "=""" & openingtext & """&RC[2]"
>
>-OR-
>
>openingtext = "<" & openingtext & "> "
>ActiveCell.Value = "=" & Chr$(34) & openingtext & Chr$(34) & "&RC[2]"


Hi Jim

OK thanks for that. It worked perfectly first time.


I'm grateful for your time and expertise.


Best Wishes


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the cell format doesn't change existing cell content Kate Microsoft Excel Misc 2 14th Jan 2010 04:44 PM
Combining Cell Content PaolaAndrea Microsoft Excel Misc 2 9th May 2008 06:52 PM
Combining cell contents when there is content to combine =?Utf-8?B?UmljaGFyZA==?= Microsoft Excel Misc 2 21st Jun 2006 07:30 PM
Appending to a Cell doesn't keep format of existing content DejaUser Microsoft Excel Programming 3 25th Jan 2006 09:43 PM
Is cell content text or numeric-need help with existing code dan Microsoft Excel Programming 3 28th Feb 2004 07:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:34 PM.