Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to add "

I have an entire worksheet that I now need to add " (an apostrophe) to the
start of each cell and " to the end of it to enclose the text within. Is it
possible to create a macro for this?

Any help would be greatly appreciated.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Macro to add "


Hi Rebecca,

Select the target range and
Try this...

Sub test()
Dim cell As Object

For Each cell In Selection
If cell.Value < "" Then
cell.Value = """" & cell.Value & """"
End If
Next cell
End Sub

Regards
Ankur Kanchan
www.xlmacros.com


On Dec 20, 11:13 am, Rebecca Plumridge <Rebecca
wrote:
I have an entire worksheet that I now need to add " (an apostrophe) to the
start of each cell and " to the end of it to enclose the text within. Is it
possible to create a macro for this?

Any help would be greatly appreciated.

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to add "

Thanks so much!! Worked first time and saved me hours of grief!!

"ankur" wrote:


Hi Rebecca,

Select the target range and
Try this...

Sub test()
Dim cell As Object

For Each cell In Selection
If cell.Value < "" Then
cell.Value = """" & cell.Value & """"
End If
Next cell
End Sub

Regards
Ankur Kanchan
www.xlmacros.com


On Dec 20, 11:13 am, Rebecca Plumridge <Rebecca
wrote:
I have an entire worksheet that I now need to add " (an apostrophe) to the
start of each cell and " to the end of it to enclose the text within. Is it
possible to create a macro for this?

Any help would be greatly appreciated.

Thanks



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
2007 Need macro to auto set option buttons all to "Yes" or "No" Paula Excel Worksheet Functions 1 October 20th 09 08:07 PM
Change default in input box from "20" to "000000"? Have macro continue on to name sheet tab? StargateFanFromWork[_4_] Excel Programming 7 October 29th 06 11:46 AM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM
"Clean Me" Macro is giving "#VALUE!" error in the Notes field. Ryan Watkins Excel Programming 1 June 11th 05 12:25 AM
Sending macro based e-mail with built-in "Heading" and "Text" Prabha Excel Programming 3 January 17th 05 02:11 PM


All times are GMT +1. The time now is 08:22 AM.

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

About Us

"It's about Microsoft Excel"