Formatting Cells

A

Aneesh

Hi

I have a worksheet full of numbers 7 columns and 500 rows. Column number 4 has data (12344, 128763, A8923, 1284D, etc...) and I want to convert it into ('12344', '128763', 'A8923', '1284D', etc...)

Basically, I just want to add single quotes around the text field in each cell

NE help will be appreciated

Thanks
Aneesh.
 
F

Frank Kabel

Hi
one way: use the following macro
sub foo()
dim rng as range
dim cell as range
set rng = activesheet.range("D1:D100")
for each cell in rng
if cell.value<>"" then
cell.value="'" & cell.value & "'"
end if
next
end sub
-----Original Message-----
Hi,

I have a worksheet full of numbers 7 columns and 500
rows. Column number 4 has data (12344, 128763, A8923,
1284D, etc...) and I want to convert it into
('12344', '128763', 'A8923', '1284D', etc...)
 
E

Earl Kiosterud

Aneesh,

In another column:
="'" & A2 & "'"

That's a quote mark, an apostrophe, and a quote mark. An apostrophe inside
quote marks, per se.

Note that this will yield text, even where the original cell contained a
number.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

Aneesh said:
Hi,

I have a worksheet full of numbers 7 columns and 500 rows. Column number 4
has data (12344, 128763, A8923, 1284D, etc...) and I want to convert it into
('12344', '128763', 'A8923', '1284D', etc...)
 
J

JE McGimpsey

One way:

In a blank column, enter this in row 1

="'" & D1 & "'"

copy down as far as necessary.

Select the blank column and Copy. Select column D and choose Edit/Paste
Special, clicking the Values radio button. Click OK. Delete the helper
column.
 
Top