Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    2 small questions.

    pcommPS.SetText (Range("J" & r) & " " & Range("K" & r)), 19, 19

    Range("K" & r) is a 4 digit number. How can I format this to not drop preceding zero's?

    Format(Range("K" & r),####) ??

    Also:

    Range H11 is populated with application.username from the w/b open event.

    I need in H18 to extract the initials from H11. eg: JB for Joe Bloggs, same for Joe Eddie Andrew Frederico Bloggsy.

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    (1) Use Format(Range("K" & r), "0000")

    (2)

    Code:
    Dim strFirst As String
    Dim strLast As String
    Dim arrNames As Variant
    strFirst = Left(Range("H11"), 1)
    arrNames = Split(Range("H11"), " ")
    If UBound(arrNames) > 0 Then
    strLast = arrNames(UBound(arrNames))
    strLast = Left(strLast, 1)
    End If
    Range("H18") = strFirst & strLast

  3. #3

Posting Permissions

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