Need to Keeping Same Display Value on 2 Workbooks

G

GEdwards

I am using Excel 2003 and have 2 XLS files.

In Workbook1 cell A1 is defined as =TEXT(NOW(),"yymmddhhmmss") which, for
example, correctly displays the format of 100409153548.

Workbook2 has a macro (thanks to Ron de Bruin) that copies data from
Workbook1 to Workbook2. My issue is the value from Workbook1 cell A1 shows
in Workbook2 as ...

1.00409E+11

How can I get the copied cell in Workbook2 to display as 100409153548?


Part of the macro that copies the data over uses the Value property to copy
a range to Workbook2, as follows...

With SourceRange
Set DestRange = DestRange.Resize(.Rows.Count, .Columns.Count)
End With
DestRange.Value = SourceRange.Value
 
O

ozgrid.com

Try
With DestRange
.Value = Format(SourceRange.Value,"yymmddhhmmss")
.EntireColumn.AutoFit
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top