Thread: Macro to add "
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rebecca Plumridge[_2_] Rebecca Plumridge[_2_] is offline
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