+ Reply to Thread
Results 1 to 7 of 7

Find value starting with "1" in column H

  1. #1
    Forum Contributor vijay2482's Avatar
    Join Date
    03-03-2009
    Location
    Paris,France
    MS-Off Ver
    Excel 2003
    Posts
    263

    Smile Find value starting with "1" in column H

    Hi all,

    I have a excel sheet in which there may be values starting with "1" in column H ( column 8)
    eg:"1530501" (7 digits)
    In this case I like to add 3 zeros ("000") in front of this value.
    Expected value: 0001530501

    I wrote the below code, but not sure what I wrote is correct or not.
    Please Login or Register  to view this content.
    I'm not sure whether its right to use "+".

    Any help will be helpfull.
    Thanks in advance.
    Last edited by vijay2482; 06-02-2009 at 10:18 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find value starting with "1" in column H

    & is the string catenation operator. The + will work in most instances, but the & makes it abundantly clear.

    There is no Length property of a range. Maybe
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor vijay2482's Avatar
    Join Date
    03-03-2009
    Location
    Paris,France
    MS-Off Ver
    Excel 2003
    Posts
    263

    Re: Find value starting with "1" in column H

    I used the below code:
    Please Login or Register  to view this content.
    There is no difference in the output
    Any help please

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Find value starting with "1" in column H

    You need more than that

    Please Login or Register  to view this content.
    I don't think you will have true numbers because they start with a zero,you could of course format the column
    Last edited by royUK; 06-02-2009 at 09:15 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Contributor vijay2482's Avatar
    Join Date
    03-03-2009
    Location
    Paris,France
    MS-Off Ver
    Excel 2003
    Posts
    263

    Re: Find value starting with "1" in column H

    Thanks for your reply.

    what does
    Please Login or Register  to view this content.
    code mean?
    I did not get the desired output.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find value starting with "1" in column H

    Two ways you could do this -- one changes the number formatting, the other changes the text to a string:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor vijay2482's Avatar
    Join Date
    03-03-2009
    Location
    Paris,France
    MS-Off Ver
    Excel 2003
    Posts
    263

    Re: Find value starting with "1" in column H

    Thanks a lot for your help.
    I tried your 1st method of code.
    It did exactly what I needed.

    Thanks once again

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1