+ Reply to Thread
Results 1 to 13 of 13

Leading Zeros-Is this possible?

Hybrid View

  1. #1
    Registered User
    Join Date
    06-07-2007
    Posts
    19

    Leading Zeros-Is this possible?

    Good Morning,

    I am looking for a way to ensure that all the leading zeros in one column are present without having to format the column cell be cell. Is this possible?

    Cheers

    Claire

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446
    Hi,

    Select the column you want to format with leading zeros, by clicking the column header.

    Go to Format > Cells > Number Tab > Text
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    06-07-2007
    Posts
    19
    Hi,

    Tried that, the problem is that the cells have already been populated but they don't seem to have been formatted, so by the time it reaches me I'm not sure if certain cells are supposed to have 1 or 2 leading zeros. Does that make sense? Looking for a solution to this as we are receiving worksheets with thousands of assets each month.

    Thanks

    Claire

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446
    So when you get this data it doesn't have the leading zeros?

  5. #5
    Registered User
    Join Date
    06-07-2007
    Posts
    19
    No, but it should have, it's being populated by different people and then passed to us, so I don't know if they're sheets have been formatted

  6. #6
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446
    If its the same workbook being populated every time, you could put this code in the workbook,

    Private Sub Workbook_Open()
    Columns("A:A").NumberFormat = "@"
    End Sub
    so it runs every time the workbook is opened, and formats the column to text. Then when it's populated it will always be formatted correctly.

+ 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