0

When i am running this code it changes the date format from dd:mm:yy to mm:dd:yy.

please give me some tips for this. Although it gets my job done how to keep the date format as it is?

Sub copyAllselectedWbtoSheets()
Set destWB = ActiveWorkbook
Dim DestCell As Range
FileNames = Application.GetOpenFilename( _
        filefilter:="Excel Files (*.csv*),*.csv*", _
        Title:="Select the workbooks to load.", MultiSelect:=True)
If IsArray(FileNames) = False Then
    If FileNames = False Then
        Exit Sub
    End If
End If
For N = LBound(FileNames) To UBound(FileNames)
    Set wb = Workbooks.Open(fileName:=FileNames(N), ReadOnly:=True)
    With wb
      .Sheets(1).Copy After:=destWB.Sheets(destWB.Sheets.Count)
      ActiveSheet.Name = Replace(wb.Name, ".csv", "ABC") 'Name sheet
      .Close True
    End With
Next N
End Sub
KarSho
  • 5,699
  • 13
  • 45
  • 78
user1960257
  • 47
  • 1
  • 2
  • 9

1 Answers1

0

So if you haven't read these posts simply do a date formatting. But this is temporary. You stil have to do the above regional setting changes if you need to have once for all solution.

Format(yourdate, "dd:mm:yy")

Community
  • 1
  • 1
bonCodigo
  • 14,268
  • 1
  • 48
  • 91