Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding a line Chart Type to a stacked-clustered Chart Type | Charts and Charting in Excel | |||
interchange columns with rows | Excel Discussion (Misc queries) | |||
How can I find the common names in two columns of names? | Excel Discussion (Misc queries) | |||
Stock Quotes in Excel 2003 | Excel Discussion (Misc queries) | |||
adding only positive numbers | Excel Discussion (Misc queries) |