ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Paste TextBox value to worksheet with specific format (https://www.excelbanter.com/excel-programming/431002-paste-textbox-value-worksheet-specific-format.html)

Patrick C. Simonds

Paste TextBox value to worksheet with specific format
 
How can I make the result placed in rng(1, 13) have the format of
mm/dd/yy? the format of Textbox4 is ddd mmm dd yy.

Private Sub CommandButton1_Click()

Dim rng
Set rng = Cells(ActiveCell.Row, 1)

rng(1, 13).Value = TextBox4.Value 'Date of Contact

Unload Me

End Sub


JLGWhiz[_2_]

Paste TextBox value to worksheet with specific format
 
Try this Patrick. Excel does not like the name of the day as part of the
date group.

rng(1, 13) = Format(Mid(TextBox4.Value, 5), "mm/dd/yy")



"Patrick C. Simonds" wrote in message
...
How can I make the result placed in rng(1, 13) have the format of
mm/dd/yy? the format of Textbox4 is ddd mmm dd yy.

Private Sub CommandButton1_Click()

Dim rng
Set rng = Cells(ActiveCell.Row, 1)

rng(1, 13).Value = TextBox4.Value 'Date of Contact

Unload Me

End Sub





All times are GMT +1. The time now is 07:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com