ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Add text to cell (https://www.excelbanter.com/excel-discussion-misc-queries/73250-add-text-cell.html)

superkopite

Add text to cell
 

Hiya guys and gals,

How can I create a Macro that when i select a range of sells will add a
predifined text to the end of the text already in each selected cell.

I konw this is possible and have tried lots of variants of code, all
turning out to be incorrect.

Kind Regards

James


--
superkopite
------------------------------------------------------------------------
superkopite's Profile: http://www.excelforum.com/member.php...o&userid=29496
View this thread: http://www.excelforum.com/showthread...hreadid=515405


Bob Phillips

Add text to cell
 
Sub AddText()
For Each cell In selection
cell.Value = "cell.value & "more text"
Next cell
End SUb

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"superkopite"
wrote in message
...

Hiya guys and gals,

How can I create a Macro that when i select a range of sells will add a
predifined text to the end of the text already in each selected cell.

I konw this is possible and have tried lots of variants of code, all
turning out to be incorrect.

Kind Regards

James


--
superkopite
------------------------------------------------------------------------
superkopite's Profile:

http://www.excelforum.com/member.php...o&userid=29496
View this thread: http://www.excelforum.com/showthread...hreadid=515405




superkopite

Add text to cell
 

Thanks a lot Bob

There was an extra " in there but when i removed it it worked
fantastically

Cheers

James


--
superkopite
------------------------------------------------------------------------
superkopite's Profile: http://www.excelforum.com/member.php...o&userid=29496
View this thread: http://www.excelforum.com/showthread...hreadid=515405


Bob Phillips

Add text to cell
 
so there was, sorry about that.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"superkopite"
wrote in message
...

Thanks a lot Bob

There was an extra " in there but when i removed it it worked
fantastically

Cheers

James


--
superkopite
------------------------------------------------------------------------
superkopite's Profile:

http://www.excelforum.com/member.php...o&userid=29496
View this thread: http://www.excelforum.com/showthread...hreadid=515405





All times are GMT +1. The time now is 06:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com