Hi All
I need to copy some data from one sheet to another using vba. Two of the fields I need to copy are in date format (dd/mm/yyyy). I am using the following syntax to paste them into another workbook:
j is a counter in a loop as I am looping through a list of values to determine which worksheets I need to copy data from.
The problem I have encountered is that when the data is pasted into the destination worksheet, a zero appears where I would expect to see a date. The format of the destination cells is General as I am performing a Range.Delete before copying and pasting. Is there something obviously wrong with my syntax? I have used this method of copying and pasting before, but not between workbooks. Is there something else I need to do?
Many thanks
Geraint
The lights are on but nobody's home, my elevator doesn't go to the top. I'm not playing with a full deck, I've lost my marbles. Barenaked Ladies - Crazy
I need to copy some data from one sheet to another using vba. Two of the fields I need to copy are in date format (dd/mm/yyyy). I am using the following syntax to paste them into another workbook:
Code:
Range("H2").Copy Destination:=Workbooks("GroupStats.xls").Sheets("Sheet1").Range("B" & j)
j is a counter in a loop as I am looping through a list of values to determine which worksheets I need to copy data from.
The problem I have encountered is that when the data is pasted into the destination worksheet, a zero appears where I would expect to see a date. The format of the destination cells is General as I am performing a Range.Delete before copying and pasting. Is there something obviously wrong with my syntax? I have used this method of copying and pasting before, but not between workbooks. Is there something else I need to do?
Many thanks
Geraint
The lights are on but nobody's home, my elevator doesn't go to the top. I'm not playing with a full deck, I've lost my marbles. Barenaked Ladies - Crazy