Padding Cells Results

HomePro

Board Regular
Joined
Aug 3, 2021
Messages
157
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
  6. 2011
  7. 2010
  8. 2007
  9. 2003 or older
  10. Prefer Not To Say
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
I am using text to columns to get a usable date format. I need to pad the results so they sort correctly. I formatted the column to do so but when I concatenate it it loses the padding.
Can any one help me?
Mileage_Report.xlsx
HIJKLM
1Order DateDateRESULTSNEEDED
2Fri, Jul 1, 2022 at 9:00AMJul012022Jul-1-2022JUL-01-202
3Fri, Jul 1, 2022 at 9:00AMJul012022Jul-1-2022Jul-01-2022
4Tue, Jul 5, 2022 at 9:00AMJul052022Jul-5-2022Jul-05-2022
5Tue, Jul 5, 2022 at 9:00AMJul052022Jul-5-2022Jul-05-2022
6Fri, Jul 1, 2022 at 1:30PMJul012022Jul-1-2022Jul-01-2022
7Fri, Jul 1, 2022 at 9:00AMJul012022Jul-1-2022Jul-01-2022
8Fri, Jul 1, 2022 at 9:00AMJul012022Jul-1-2022Jul-01-2022
9Fri, Jul 15, 2022 at 1:30PMJul152022Jul-15-2022Jul-15-2022
10Fri, Jul 15, 2022 at 9:00AMJul152022Jul-15-2022Jul-15-2022
11Fri, Jul 15, 2022 at 9:00AMJul152022Jul-15-2022Jul-15-2022
12Tue, Jul 5, 2022 at 9:00AMJul052022Jul-5-2022Jul-05-2022
13Tue, Jul 5, 2022 at 9:00AMJul052022Jul-5-2022Jul-05-2022
14Wed, Jul 6, 2022 at 9:00AMJul062022Jul-6-2022Jul-06-2022
Sheet1
Cell Formulas
RangeFormula
L2:L14L2=CONCATENATE(I2,"-",J2,"-",K2)
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
How about
Excel Formula:
=DATE(K2,MONTH("1/"&I2),J2)
and format the cell as date.
 
Upvote 0
as always - right on point. tks.
But that creates an un seen complication. the next step was to get the oldest and newest dates and add that to the file name.
But the date code does not translate to the file name as dates. Thats why i was just trying to pad the cells.
I would like to save the file name as Filename "2022 - July - 06-185/ so I new the range for the report.
Any ideas?
 
Upvote 0
How are you creating the file name?
 
Upvote 0
I am concatenating the information from individual cells and assigning a variable at saving.
Also I was trying to save it to an online storage drive without mapping to location but that does not seem to work.


'Save File
LC = "Z:\_Operations\HPI\--- Weekly Metrics\Inspectors Mileage"
FN = "Inspectgor Mileage - "
DT = Sheets("Sheet1").Cells(1, "m")
FilePath = LC & "\" & FN & DT & ".xls"
Application.DisplayAlerts = False
ActiveWorkbook.saveas Filename:=FilePath, FileFormat:=xlExcel8
Application.DisplayAlerts = True
Application.Quit

[this is the desired save to location that i could not get to work]
'LC=https://work.zoho.com/#workdrive/ho...folders/rdj8id0786001aa5c4d2ba095f37928e04cf0"
 
Upvote 0
You need to format as a date like
VBA Code:
DT = Format(Sheets("Sheet1").Cells(1, "m"),"mmm-dd-yyyy")
 
Upvote 0
Upvote 0
I know the post is wrong - but any idea on how to save it to a web drive? Should I start a new post?
 
Upvote 0

Forum statistics

Threads
1,215,854
Messages
6,127,342
Members
449,377
Latest member
CastorPollux

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top