Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy column containing mixed data 1

Status
Not open for further replies.

rogerte

Programmer
Nov 9, 2001
164
GB
I am copying data from one workbook to another workbook, and basically it works fine.

The only problem is that is if one column consists of data that that could be a number, but is actually text it is saved in the new column as a number.

e.g. donor column contains: 4.w, 5.15m, 7f, 09.00, 6m. The recipient column will contain 4.w, 5.15m, 7f, 9, 6m

I am using:
Code:
ThisWorkBook.Sheets(2).Range("C" & i & ":C" & k) = ImportFile.Sheets(1).Range("C2:C" & j).Value

I have tried searching for a solution - but so far Google hasn't been my friend - possibly me not using the correct search text.
Is there an easy way to keep the format?

Many thanks

Roger
 

hi,

If you select the cell that displays 09.00, and look at the FORMULA BAR, rather than the CELL, what do you see in the FORMULA BAR?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I'd try this:
Code:
ImportFile.Sheets(1).Range("C2:C" & j).Copy ThisWorkBook.Sheets(2).Range("C" & i)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,

Thanks - that worked a treat

Cheers

Roger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top