Consulting

Results 1 to 3 of 3

Thread: Changing numberformat

  1. #1
    VBAX Regular
    Joined
    Apr 2011
    Posts
    24
    Location

    Changing numberformat

    Hi,
    I have over 100 spreadsheets with "SampleID" going from 1 to 100.
    I want to read this from each spreadsheet and concatenate to a string called "WSD1122".

    Before concatenation I want to change the number to a fixed length 5 digit string like "00001" ... "00100"

    so that my final value of sample ID would look like WSD112200001 ..... WSD112200100

    I would appreciate your help.

  2. #2
    VBAX Expert CatDaddy's Avatar
    Joined
    Jun 2011
    Posts
    581
    Location
    [VBA]Range("A1").value = "WSD1122" & Format(Range("A1").value, "00000")[/VBA]
    ------------------------------------------------
    Happy Coding my friends

  3. #3
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,729
    Location
    100 different workbooks or 1 workbook with 100 sheets?

    Does the SampleID occur in the same place

    Does it occur more than once on a worksheet.

    Maybe a sample would help

    Paul

Posting Permissions

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