Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #111318

Re: VBA code to change numeric value to string

From Claus Busch <claus_busch@t-online.de>
Newsgroups microsoft.public.excel.programming
Subject Re: VBA code to change numeric value to string
Date 2020-01-20 13:39 +0100
Organization A noiseless patient Spider
Message-ID <r04723$4l8$1@dont-email.me> (permalink)
References <c699f08c-a06d-40e6-9d11-034aaf0968ba@googlegroups.com>

Show all headers | View raw


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

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

VBA code to change numeric value to string hbj <hakan.bjorkstrom@gmail.com> - 2020-01-20 04:36 -0800
  Re: VBA code to change numeric value to string Claus Busch <claus_busch@t-online.de> - 2020-01-20 13:39 +0100
    Re: VBA code to change numeric value to string hbj <hakan.bjorkstrom@gmail.com> - 2020-01-21 07:53 -0800
      Re: VBA code to change numeric value to string GS <gs@v.invalid> - 2020-01-21 12:41 -0500
        Re: VBA code to change numeric value to string Lepista <Lepista.186dd008@excelbanter.com> - 2020-01-22 09:41 +0000
          Re: VBA code to change numeric value to string hbj <hakan.bjorkstrom@gmail.com> - 2020-01-25 08:35 -0800

csiph-web