Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
confused
 
Posts: n/a
Default Inserting Quotation Marks in all Cells

Hi!

I have a co-worker who needs to insert quotation marks in the entire
worksheet. It contains both numbers and text. The quotation marks need to
be inserted around each individual cells data.

Can someone help?
  #2   Report Post  
Gary''s Student
 
Posts: n/a
Default Inserting Quotation Marks in all Cells

Enter this small macro:

Sub quoteit()
Dim r As Range
For Each r In Selection
If IsEmpty(r.Value) Then
Else
r.Value = Chr(34) & r.Value & Chr(34)
End If
Next
End Sub

Select all or some portion of the worksheet and run the macro. It will put
quote marks before and after the contents of all selected non-empty cells
--
Gary's Student


"confused" wrote:

Hi!

I have a co-worker who needs to insert quotation marks in the entire
worksheet. It contains both numbers and text. The quotation marks need to
be inserted around each individual cells data.

Can someone help?

  #3   Report Post  
confused
 
Posts: n/a
Default Inserting Quotation Marks in all Cells

Hey Thanks!

Now, can you make it insert quotation marks in empty cells as well as cells
containing data?

"Gary''s Student" wrote:

Enter this small macro:

Sub quoteit()
Dim r As Range
For Each r In Selection
If IsEmpty(r.Value) Then
Else
r.Value = Chr(34) & r.Value & Chr(34)
End If
Next
End Sub

Select all or some portion of the worksheet and run the macro. It will put
quote marks before and after the contents of all selected non-empty cells
--
Gary's Student


"confused" wrote:

Hi!

I have a co-worker who needs to insert quotation marks in the entire
worksheet. It contains both numbers and text. The quotation marks need to
be inserted around each individual cells data.

Can someone help?

  #4   Report Post  
Gary''s Student
 
Posts: n/a
Default Inserting Quotation Marks in all Cells

Yes. We will just get rid of the IF:

Sub quoteit()
Dim r As Range
For Each r In Selection
r.Value = Chr(34) & r.Value & Chr(34)
Next
End Sub

--
Gary's Student


"confused" wrote:

Hey Thanks!

Now, can you make it insert quotation marks in empty cells as well as cells
containing data?

"Gary''s Student" wrote:

Enter this small macro:

Sub quoteit()
Dim r As Range
For Each r In Selection
If IsEmpty(r.Value) Then
Else
r.Value = Chr(34) & r.Value & Chr(34)
End If
Next
End Sub

Select all or some portion of the worksheet and run the macro. It will put
quote marks before and after the contents of all selected non-empty cells
--
Gary's Student


"confused" wrote:

Hi!

I have a co-worker who needs to insert quotation marks in the entire
worksheet. It contains both numbers and text. The quotation marks need to
be inserted around each individual cells data.

Can someone help?

  #5   Report Post  
confused
 
Posts: n/a
Default Inserting Quotation Marks in all Cells

Okay then! Thanks sooo much!

"Gary''s Student" wrote:

Yes. We will just get rid of the IF:

Sub quoteit()
Dim r As Range
For Each r In Selection
r.Value = Chr(34) & r.Value & Chr(34)
Next
End Sub

--
Gary's Student


"confused" wrote:

Hey Thanks!

Now, can you make it insert quotation marks in empty cells as well as cells
containing data?

"Gary''s Student" wrote:

Enter this small macro:

Sub quoteit()
Dim r As Range
For Each r In Selection
If IsEmpty(r.Value) Then
Else
r.Value = Chr(34) & r.Value & Chr(34)
End If
Next
End Sub

Select all or some portion of the worksheet and run the macro. It will put
quote marks before and after the contents of all selected non-empty cells
--
Gary's Student


"confused" wrote:

Hi!

I have a co-worker who needs to insert quotation marks in the entire
worksheet. It contains both numbers and text. The quotation marks need to
be inserted around each individual cells data.

Can someone help?

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
Inserting carriage returns in Excel cells Alyce Excel Discussion (Misc queries) 5 September 13th 06 03:46 PM
how do i protect cells in a shared worksheet Debi Excel Discussion (Misc queries) 3 September 30th 05 11:15 PM
Conditional formatting...cont. from 9/25 Guenzak Excel Discussion (Misc queries) 4 September 26th 05 10:55 PM
Excel Quotation Marks! MaxFrance Excel Discussion (Misc queries) 6 March 29th 05 10:45 AM
inserting row into linked cells Laurel Excel Worksheet Functions 2 December 14th 04 05:47 PM


All times are GMT +1. The time now is 01:28 PM.

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

About Us

"It's about Microsoft Excel"