gscarter
07-17-2008, 09:04 AM
Hello,
Using the code below i am copying values from two worksheets into one.
Private Sub CopyData(path1, path2)
Set wb1 = Workbooks.Open(path1, True, True)
Set wb2 = Workbooks.Open(path2, True, True)
With ThisWorkbook.Worksheets("Sheet1")
.Columns("A:B").Value = wb1.Worksheets(sheetName(TextBox1)).Columns("A:B").Value
.Columns("D:E").Value = wb2.Worksheets(sheetName(TextBox2)).Columns("A:B").Value
End With
End Sub
The problem i am having is when i copy over any values with 'E's in it is copying them as exponentials rather than just E's. For example:
5697E93
will copy as:
5.70E+96
Anyone got any ideas?
Ive tried using .formula and .text instead of .value.
.formula copied the same
.text copied no values
Any fixes need to be coded, as i do not create the spreadsheets, this is the format they are given to me.
I am using Microsoft Office XP (2002) Excel spreadsheets
Hope you can help
Gary
Using the code below i am copying values from two worksheets into one.
Private Sub CopyData(path1, path2)
Set wb1 = Workbooks.Open(path1, True, True)
Set wb2 = Workbooks.Open(path2, True, True)
With ThisWorkbook.Worksheets("Sheet1")
.Columns("A:B").Value = wb1.Worksheets(sheetName(TextBox1)).Columns("A:B").Value
.Columns("D:E").Value = wb2.Worksheets(sheetName(TextBox2)).Columns("A:B").Value
End With
End Sub
The problem i am having is when i copy over any values with 'E's in it is copying them as exponentials rather than just E's. For example:
5697E93
will copy as:
5.70E+96
Anyone got any ideas?
Ive tried using .formula and .text instead of .value.
.formula copied the same
.text copied no values
Any fixes need to be coded, as i do not create the spreadsheets, this is the format they are given to me.
I am using Microsoft Office XP (2002) Excel spreadsheets
Hope you can help
Gary