S
Striker
I am copying a large range, nealy 60K rows. One of the colums has a 15 digit
number in it. The destination cell is pre-formatted as text, and I want to
keep it that way. However when I copy the range from the CSV file to the
template, the formatting goes with it. Code below, how can I maintain the
formatting I have in the destination sheet?
Dim iLastRow As Long
Dim sFile1 As String
Dim wb, wkbkCSV As Workbook
Dim rDestCell As Range
sFile1 = Application.GetOpenFilename("CSV Files, *.csv")
If sFile1 = "False" Then
Exit Sub
End If
Set rDestCell = Workbooks("Sessions.xlsm").Worksheets("Sheet1").Range("A2")
Set wkbkCSV = Workbooks.Open(Filename:=sFile1)
With wkbkCSV
.Worksheets(1).UsedRange.Copy Destination:=rDestCell
.Close savechanges:=False
End With
number in it. The destination cell is pre-formatted as text, and I want to
keep it that way. However when I copy the range from the CSV file to the
template, the formatting goes with it. Code below, how can I maintain the
formatting I have in the destination sheet?
Dim iLastRow As Long
Dim sFile1 As String
Dim wb, wkbkCSV As Workbook
Dim rDestCell As Range
sFile1 = Application.GetOpenFilename("CSV Files, *.csv")
If sFile1 = "False" Then
Exit Sub
End If
Set rDestCell = Workbooks("Sessions.xlsm").Worksheets("Sheet1").Range("A2")
Set wkbkCSV = Workbooks.Open(Filename:=sFile1)
With wkbkCSV
.Worksheets(1).UsedRange.Copy Destination:=rDestCell
.Close savechanges:=False
End With