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?
0
Confused1 (124)
10/18/2005 7:22:02 PM
excel.misc 78881 articles. 5 followers. Follow

4 Replies
651 Views

Similar Articles

[PageSpeed] 18

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?
0
GarysStudent (1572)
10/18/2005 8:14:01 PM
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?
0
Confused1 (124)
10/18/2005 8:51:10 PM
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?
0
GarysStudent (1572)
10/18/2005 9:41:50 PM
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?
0
Confused1 (124)
10/19/2005 12:49:02 PM
Reply:

Similar Artilces: