ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 6,150
- Office Version
- 2024
- Platform
- Windows
I am using the code shown below
In my worksheet in column B is a long value.
This long value is entered into my user form called MotorcycleDatbase at Text Box2
It is loaded as the shown format 1HFSC47N67A600508
I would like it to be shown as a custom format so its like this 1HF SC47N 6 7 A 600508 also see image supplied
So 1HF SPACE SC47N SPACE 6 SPACE 7 SPACE A SPACE 600508
Then all entered values will take on the same appearance
In my worksheet in column B is a long value.
This long value is entered into my user form called MotorcycleDatbase at Text Box2
It is loaded as the shown format 1HFSC47N67A600508
I would like it to be shown as a custom format so its like this 1HF SC47N 6 7 A 600508 also see image supplied
So 1HF SPACE SC47N SPACE 6 SPACE 7 SPACE A SPACE 600508
Then all entered values will take on the same appearance
Rich (BB code):
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = 2 Then
If Target.Offset(, 1) = "HONDA" Then
Sheets("MCVIN").Range("F7").Value = ActiveCell.Value
Else
MsgBox "YOU CAN ONLY SELECT HONDA", vbCritical, "HONDA ONLY MESSAGE"
Exit Sub
End If
Else
MsgBox "YOU MUST SELECT THE VIN IN COLUMN B", vbCritical, "SELECT VIN MESSAGE"
Exit Sub
End If
Worksheets("MCVIN").Activate
Worksheets("MCLIST").Activate
MotorcycleDatabase.LoadData Me, Target.Row
End Sub