Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mj
 
Posts: n/a
Default Adding quotes to columns

I have over 12,000 numbers in 2 columns that I need to add quotes to. They
need to be before and after each number.
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Here is one way with VBA


For Each cell In ActiveSheet.UsedRange
If cell.Value < "" Then
cell.Value = Chr(34) & cell.Value & Chr(34)
End If
Next cell


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mj" wrote in message
...
I have over 12,000 numbers in 2 columns that I need to add quotes to.

They
need to be before and after each number.



  #3   Report Post  
Jason Morin
 
Posts: n/a
Default

Sub AddQuotes()
Dim rng As Range
Dim cell As Range

On Error Resume Next
Set rng = ActiveSheet.Cells. _
SpecialCells(xlCellTypeConstants, xlNumbers)
If rng Is Nothing Then Exit Sub

For Each cell In rng
With cell
.Value = Chr(34) & .Value & Chr(34)
End With
Next
End Sub

---
HTH
Jason
Atlanta, GA


-----Original Message-----
I have over 12,000 numbers in 2 columns that I need to

add quotes to. They
need to be before and after each number.
.

  #4   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Note: if your numbers are formatted for fewer decimal places than their
stored values (i.e, 1.2345 displayed as 1.23), and you only want to keep
the displayed values, use

cell.Value = Chr(34) & cell.Text & Chr(34)

rather than

cell.Value = Chr(34) & cell.Value & Chr(34)



In article ,
"Bob Phillips" wrote:

Here is one way with VBA


For Each cell In ActiveSheet.UsedRange
If cell.Value < "" Then
cell.Value = Chr(34) & cell.Value & Chr(34)
End If
Next cell


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mj" wrote in message
...
I have over 12,000 numbers in 2 columns that I need to add quotes to.

They
need to be before and after each number.

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
Adding a line Chart Type to a stacked-clustered Chart Type Debbie Charts and Charting in Excel 2 January 5th 05 11:25 PM
interchange columns with rows Herman Excel Discussion (Misc queries) 2 December 8th 04 05:40 PM
How can I find the common names in two columns of names? hako Excel Discussion (Misc queries) 2 December 8th 04 01:59 AM
Stock Quotes in Excel 2003 David B. Excel Discussion (Misc queries) 0 December 1st 04 08:41 PM
adding only positive numbers Jacob Excel Discussion (Misc queries) 2 November 30th 04 12:24 AM


All times are GMT +1. The time now is 03:49 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"