Concatenate Date and text using excel macro
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Concatenate Date and text using excel macro

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    Andrew
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I am trying to take the current date and add text to it. The problem I am having is I need the date in this format dd/mm. Here is the final outcome I am looking for:

    03/07HOLD01

    I need the date to be the current date and only have 12 characters to play with.

    Thanks

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    2,936
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    You said you want it in dd/mm format but your example (assuming you were using today) is in mm/dd. However, you can easily change this code to whatever you need.

    Regards,
    D

    Code:
    Sub DatePlusString()
    Dim strYourString
    strYourString = Format(Date, "mm/dd") & "HOLD01"
    MsgBox strYourString
    End Sub

  3. #3
    New Member
    Join Date
    Mar 2002
    Location
    Andrew
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Worked great...thanks!!

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com