Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Is there an easy way to do this? (formatting numbers)

I have a column of numbers (nearly 400 or more) in two separate
spreadsheets.

I need to copy this column of numbers into a SQL query, and to do that,
I will have to have it formatted like:

'12345',
'23456',

and so on.

It's currently:
12345
23456

Is there a way that I can format/edit each cell (other than manually) to
format it to bring it into SQL for a query?

Any help/ideas appreciated.

Thanks,

BC
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Is there an easy way to do this? (formatting numbers)

Select your values and run:


Sub dont_quote_me()
Dim r As Range
For Each r In Selection
r.Value = Chr(34) & r.Value & Chr(34)
Next
End Sub
--
Gary''s Student


"Blasting Cap" wrote:

I have a column of numbers (nearly 400 or more) in two separate
spreadsheets.

I need to copy this column of numbers into a SQL query, and to do that,
I will have to have it formatted like:

'12345',
'23456',

and so on.

It's currently:
12345
23456

Is there a way that I can format/edit each cell (other than manually) to
format it to bring it into SQL for a query?

Any help/ideas appreciated.

Thanks,

BC

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Is there an easy way to do this? (formatting numbers)

If you really need a single quote (apostrophe), then use CHAR(39) instead.

Note that the leading quote will be visible in the formula bar, not in the
cell.
--
Gary''s Student


"Blasting Cap" wrote:

I have a column of numbers (nearly 400 or more) in two separate
spreadsheets.

I need to copy this column of numbers into a SQL query, and to do that,
I will have to have it formatted like:

'12345',
'23456',

and so on.

It's currently:
12345
23456

Is there a way that I can format/edit each cell (other than manually) to
format it to bring it into SQL for a query?

Any help/ideas appreciated.

Thanks,

BC

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Is there an easy way to do this? (formatting numbers)

Gary''s Student wrote:
If you really need a single quote (apostrophe), then use CHAR(39) instead.

Note that the leading quote will be visible in the formula bar, not in the
cell.



I did.

I got around it by putting in chr(39) & chr(39) - two single quotes - to
start the line.

Thanks for the help!!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Is there an easy way to do this? (formatting numbers)

You are very welcome!
--
Gary''s Student


"Blasting Cap" wrote:

Gary''s Student wrote:
If you really need a single quote (apostrophe), then use CHAR(39) instead.

Note that the leading quote will be visible in the formula bar, not in the
cell.



I did.

I got around it by putting in chr(39) & chr(39) - two single quotes - to
start the line.

Thanks for the help!!



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
I think an easy Conditional Formatting ? Scott Excel Discussion (Misc queries) 5 February 23rd 10 07:38 PM
% on numbers - (easy question probably) instereo911 via OfficeKB.com Excel Discussion (Misc queries) 3 April 27th 07 08:52 PM
Negative numbers in easy formula getting me down... jennieoh Excel Discussion (Misc queries) 3 June 9th 06 05:04 PM
Easy question? Page numbers ATC Excel Discussion (Misc queries) 1 February 1st 06 04:27 AM
Formatting Borders - Easy FuadsCurse Excel Discussion (Misc queries) 5 December 23rd 04 03:21 AM


All times are GMT +1. The time now is 03:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"