Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I think an easy Conditional Formatting ? | Excel Discussion (Misc queries) | |||
% on numbers - (easy question probably) | Excel Discussion (Misc queries) | |||
Negative numbers in easy formula getting me down... | Excel Discussion (Misc queries) | |||
Easy question? Page numbers | Excel Discussion (Misc queries) | |||
Formatting Borders - Easy | Excel Discussion (Misc queries) |