LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default keep formatting

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").Ra nge("A2")
Set wkbkCSV = Workbooks.Open(Filename:=sFile1)

With wkbkCSV
.Worksheets(1).UsedRange.Copy Destination:=rDestCell
.Close savechanges:=False
End With

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
condionally formatting based on another cells formatting? Derrick Excel Discussion (Misc queries) 2 July 31st 09 08:05 PM
Find formatting in text in cell, insert tags around formatting. CarlC Excel Programming 2 February 27th 08 09:26 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
expanding custom formatting without removing existing cell formatting? Keith Excel Worksheet Functions 3 December 27th 06 01:54 PM
Decimal Formatting in Windows English vs European Formatting Drummer361 Excel Programming 3 August 7th 06 02:48 PM


All times are GMT +1. The time now is 11:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"