ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Setting up and Configuration of Excel (https://www.excelbanter.com/setting-up-configuration-excel/)
-   -   Adding Quotation Marks to Data already in Mulitple Cells (https://www.excelbanter.com/setting-up-configuration-excel/131874-adding-quotation-marks-data-already-mulitple-cells.html)

Ron

Adding Quotation Marks to Data already in Mulitple Cells
 
How can I add quotation marks around content within multiple cells in an
excel spreadsheet without doing it manually in Office 2002? For example, If
there is data in Cells A1 through A100 and I want quotations marks around
the data in each cell is there a way to add the quotation marks in each cell
without losing the data? The data is both numeric and text.

Gary''s Student

Adding Quotation Marks to Data already in Mulitple Cells
 
Select the cells you want to modify and run:

Sub dont_quote_me()
q = Chr(34)
For Each r In Selection
r.Value = q & r.Value & q
Next
End Sub

--
Gary''s Student
gsnu200707


"Ron" wrote:

How can I add quotation marks around content within multiple cells in an
excel spreadsheet without doing it manually in Office 2002? For example, If
there is data in Cells A1 through A100 and I want quotations marks around
the data in each cell is there a way to add the quotation marks in each cell
without losing the data? The data is both numeric and text.


Ron

Adding Quotation Marks to Data already in Mulitple Cells
 
Gary,
I take that this is a vbs script? If so then how do I get it to run in
the excel spreadsheet that I'm trying to add the quotation marks to?

"Gary''s Student" wrote:

Select the cells you want to modify and run:

Sub dont_quote_me()
q = Chr(34)
For Each r In Selection
r.Value = q & r.Value & q
Next
End Sub

--
Gary''s Student
gsnu200707


"Ron" wrote:

How can I add quotation marks around content within multiple cells in an
excel spreadsheet without doing it manually in Office 2002? For example, If
there is data in Cells A1 through A100 and I want quotations marks around
the data in each cell is there a way to add the quotation marks in each cell
without losing the data? The data is both numeric and text.


Gary''s Student

Adding Quotation Marks to Data already in Mulitple Cells
 
Very easy:

1. touch ALT-F11 to bring up the VBE window
2. touch ALT-I
ALT-M to insert a fresh module
3. paste the stuff into the module
4. close the VBE window (save is not necessary)


to run the script

1. select the set of cells you want to process
2. touch ALT-F8
3. select the macro
4. touch run

--
Gary's Student
gsnu200707


"Ron" wrote:

Gary,
I take that this is a vbs script? If so then how do I get it to run in
the excel spreadsheet that I'm trying to add the quotation marks to?

"Gary''s Student" wrote:

Select the cells you want to modify and run:

Sub dont_quote_me()
q = Chr(34)
For Each r In Selection
r.Value = q & r.Value & q
Next
End Sub

--
Gary''s Student
gsnu200707


"Ron" wrote:

How can I add quotation marks around content within multiple cells in an
excel spreadsheet without doing it manually in Office 2002? For example, If
there is data in Cells A1 through A100 and I want quotations marks around
the data in each cell is there a way to add the quotation marks in each cell
without losing the data? The data is both numeric and text.



All times are GMT +1. The time now is 07:19 AM.

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