Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 703
- Office Version
-
- 365
- 2019
- Platform
-
- Windows
Greetings,
I have a column where there has to be a five digit number. Sometimes the number will lead of with Zeros. I use
This does get me what I need. However when I merge Columns "D" and "E" I loose the 5 digit minimum format that I already established. The following VBA works fine apart from dropping leading zeros. For example I could end up with something like B737\959 while I want to have B737\00959
Thank you so much and happy New Year
End Sub
I have a column where there has to be a five digit number. Sometimes the number will lead of with Zeros. I use
VBA Code:
Sub Tail_Number()
Range("E:E").NumberFormat = "00000"
End Sub
This does get me what I need. However when I merge Columns "D" and "E" I loose the 5 digit minimum format that I already established. The following VBA works fine apart from dropping leading zeros. For example I could end up with something like B737\959 while I want to have B737\00959
VBA Code:
Sub Merge_Acft_Tail()
For i = 1 To Cells(Rows.Count, "D").End(xlUp).Row
Cells(i, "D").Value = Cells(i, "D").Value & "\" & Cells(i, "E").Value
Next i
Columns(5).Delete
End Sub
Thank you so much and happy New Year
End Sub