Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to change numeric value to string
The values entered in a column should always be of string type. If the user enters a numeric value it should be changed to string. Example: if the user enters 100 it should be presented as "00100". I have tried a code into Worksheet.Change() with Cells(TargetRow,TargetColumn).value = "00100". The cell value does not change.
Hakan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to change numeric value to string
Hi Hakan,
Am Mon, 20 Jan 2020 04:36:43 -0800 (PST) schrieb hbj: The values entered in a column should always be of string type. If the user enters a numeric value it should be changed to string. Example: if the user enters 100 it should be presented as "00100". I have tried a code into Worksheet.Change() with Cells(TargetRow,TargetColumn).value = "00100". The cell value does not change. why don't you use a custom number format: 00000 Regards Claus B. -- Windows10 Office 2016 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to change numeric value to string
On Monday, January 20, 2020 at 2:39:43 PM UTC+2, Claus Busch wrote:
Hi Hakan, Am Mon, 20 Jan 2020 04:36:43 -0800 (PST) schrieb hbj: The values entered in a column should always be of string type. If the user enters a numeric value it should be changed to string. Example: if the user enters 100 it should be presented as "00100". I have tried a code into Worksheet.Change() with Cells(TargetRow,TargetColumn).value = "00100". The cell value does not change. why don't you use a custom number format: 00000 Regards Claus B. -- Windows10 Office 2016 Because that is only a presentation value - the real value will still remain numeric i.e. 100. 00100 is a zip code which will be forwarded to an external mail merging program. HÃ¥kan |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to change numeric value to string
On Monday, January 20, 2020 at 2:39:43 PM UTC+2, Claus Busch wrote:
Hi Hakan, Am Mon, 20 Jan 2020 04:36:43 -0800 (PST) schrieb hbj: The values entered in a column should always be of string type. If the user enters a numeric value it should be changed to string. Example: if the user enters 100 it should be presented as "00100". I have tried a code into Worksheet.Change() with Cells(TargetRow,TargetColumn).value = "00100". The cell value does not change. why don't you use a custom number format: 00000 Regards Claus B. -- Windows10 Office 2016 Because that is only a presentation value - the real value will still remain numeric i.e. 100. 00100 is a zip code which will be forwarded to an external mail merging program. Håkan Zip Code is a built-in 'Special' format so typing 100 displays as 00100; - why not use it? -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to change numeric value to string
On Wednesday, January 22, 2020 at 11:49:15 AM UTC+2, Lepista wrote:
=TEXT({number},"00000") -- Lepista Thank you. I'll give it a try. HÃ¥kan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text string to Numeric string | Excel Discussion (Misc queries) | |||
string and numeric | Excel Programming | |||
How do I replace last numeric string from a alphanumeric string? | Excel Discussion (Misc queries) | |||
Find numeric value at end of string | Excel Worksheet Functions | |||
Find first numeric value in text string | Excel Worksheet Functions |