Centering an InputBox and adding a Date suffix.

Is there a way to add a suffix (current date(:MM-DD-YY)) to whatever name is added in this InputBox?  Of course if the sub is Canceled.. it would be blank..

Please advise and thanks.
RWayneH
Sub InsertBRTName()
 
Dim BRT_NameWithSuffix As String
 
'Position the cursor into the cell that want the result.
    Application.Goto Reference:="InsertHere"
    ActiveCell.Offset(RowOffset:=1, ColumnOffset:=1).Activate '1 row down, one over (R)
    
BRT_NameWithSuffix = InputBox("Enter a name that best describes the animal requirements.   Note: The name entered will get a :05-21-09 suffix added to the name to capture when it was created", "Save Animals Requirements", "YrlFinishRationWBeetPulpWestLot", 100, 1) ' Get user input
 
ActiveCell.Value = BRT_NameWithSuffix  'place it in cell
 
End Sub

Open in new window

RWayneHAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RamanhpCommented:
change the row >> 
ActiveCell.Value = BRT_NameWithSuffix & Format(Now(), ":mm-dd-yy")
0
RamanhpCommented:
i forgot the condition , here we go >>

If BRT_NameWithSuffix <> "" Then ActiveCell.Value = BRT_NameWithSuffix & Format(Now(), ":mm-dd-yy") 'place it in cell
 
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Saurabh Singh TeotiaCommented:
You can use the following code and it will do what you are looking for...
Saurabh...

Sub InsertBRTName()
 
Dim BRT_NameWithSuffix As String
 
'Position the cursor into the cell that want the result.
    Application.Goto Reference:="InsertHere"
    ActiveCell.Offset(RowOffset:=1, ColumnOffset:=1).Activate '1 row down, one over (R)
    
BRT_NameWithSuffix = InputBox("Enter a name that best describes the animal requirements.   Note: The name entered will get a :05-21-09 suffix added to the name to capture when it was created", "Save Animals Requirements", "YrlFinishRationWBeetPulpWestLot", 100, 1) & ":" & Format(Now(), "mm-dd-yy")
ActiveCell.Value = BRT_NameWithSuffix
 
End Sub

Open in new window

0
RWayneHAuthor Commented:
Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.