Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Fix format to text not number

Copying a text field using code with a very long number eg 0080251105280393
and 4171053200000224 the numbers are formatted as a variant/double after
being copied with the numbers modified to fit in the 15 digit max of a number
in Excel (eg. 80251105280393 and 4171053200000220 ).

The Code:
-------------
Dim strAssetSN as String
strAssetSN = jpdDeliverySheet.Cells(10, 20)
dellValidationSheet.Cells(5, 1).NumberFormat = "@"
dellValidationSheet.Cells(5, 1) = strAssetSN


Can you please help? I need the text copied across!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Fix format to text not number

Try using

dellValidationSheet.Cells(5, 1) = "'" & strAssetSN

that is, inserting a single quote before the text.

--
Regards,

Juan Pablo González
Excel MVP

"Rowlesar" wrote in message
...
Copying a text field using code with a very long number eg
0080251105280393
and 4171053200000224 the numbers are formatted as a variant/double after
being copied with the numbers modified to fit in the 15 digit max of a
number
in Excel (eg. 80251105280393 and 4171053200000220 ).

The Code:
-------------
Dim strAssetSN as String
strAssetSN = jpdDeliverySheet.Cells(10, 20)
dellValidationSheet.Cells(5, 1).NumberFormat = "@"
dellValidationSheet.Cells(5, 1) = strAssetSN


Can you please help? I need the text copied across!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Fix format to text not number

This has worked, thank you very much. More testing to be done later today.

Andy

"Juan Pablo González" wrote:

Try using

dellValidationSheet.Cells(5, 1) = "'" & strAssetSN

that is, inserting a single quote before the text.

--
Regards,

Juan Pablo González
Excel MVP

"Rowlesar" wrote in message
...
Copying a text field using code with a very long number eg
0080251105280393
and 4171053200000224 the numbers are formatted as a variant/double after
being copied with the numbers modified to fit in the 15 digit max of a
number
in Excel (eg. 80251105280393 and 4171053200000220 ).

The Code:
-------------
Dim strAssetSN as String
strAssetSN = jpdDeliverySheet.Cells(10, 20)
dellValidationSheet.Cells(5, 1).NumberFormat = "@"
dellValidationSheet.Cells(5, 1) = strAssetSN


Can you please help? I need the text copied across!




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
Convert numbers from text format to number format merlin68 Excel Discussion (Misc queries) 7 June 20th 07 07:03 PM
Change number (in text format) to numeric format Pam Excel Discussion (Misc queries) 5 October 24th 05 07:45 PM
Hoe to change text format .126 to number format 0.126 vitality Excel Discussion (Misc queries) 3 October 6th 05 01:31 PM
convert text-format number to number in excel 2000%3f Larry Excel Discussion (Misc queries) 1 July 29th 05 08:18 PM
How do i change numbers in text format to number format? Greg New Users to Excel 1 December 14th 04 05:22 PM


All times are GMT +1. The time now is 03:53 PM.

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"