Theoutlaw700
New Member
- Joined
- Jun 8, 2022
- Messages
- 8
- Office Version
- 365
- Platform
- Windows
I cannot get this to work. Essentially, after saving my worksheet to a csv I need all cells in range E:E to be formatted "[$-en-US]mm/dd/yy hh:mm AM/PM;@" My code looks as follows:
An example of what my worksheet looks like this:
Thank you very much ahead of time.
VBA Code:
Sub SaveAsCSV()
Dim path As String
Dim fname As String
path = "Z:\Job Importing\"
fname = "This Week Schedule"
'Copy the invoice sheet to a new workbook
Sheet2.Copy
'Save the new workbook to a specified folder (This will be Z drive)
With ActiveWorkbook
.Sheets(1).Name = "Weekly Schedule"
.SaveAs Filename:=path & fname, FileFormat:=62
End With
Range("E:E").NumberFormat = "[$-en-US]mm/dd/yy hh:mm AM/PM;@"
ActiveWorkbook.Save
ActiveWorkbook.Close
'Close the Workbook
End Sub
An example of what my worksheet looks like this:
Technician | Customer | Customer ID | Job Type | Start Date [$-en-US]mm/dd/yy hh:mm AM/PM;@ | Assignment type | Job Pool? | Description |
Test | 21st Century Healthcare | 21st Century | Monthly Calibration | 06/21/22 10:29 AM | 1 | Test | |
Test | American Beverage Corp | American Beverage | Service | 06/23/22 11:20 AM | 1 | Test |
Thank you very much ahead of time.