View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Date FORMAT problem

Maybe just changing the format of the cells to match would work:

with worksheets("sheet2").range("a1")
.numberformat = worksheets("Sheet1").range("a1").numberformat
.value = worksheets("sheet1").range("a1").value
end with

or if you really don't want it to be a date:

with worksheets("sheet2").range("a1")
.numberformat = "@" 'text
.value = worksheets("sheet1").range("a1").text
end with



"Sabo, Eric" wrote:

I am trying to copy data from one worksheet to another worksheet, I am using
the following code:

Range("sheetname1!A1").value = range("sheetname2!A1).value

But everytime it is putting the data in as a date going from one worksheet
to the other worksheet, I want the data to be text only and not convert it
into a date.

Is there any easier way to copy a range of cells from one worksheet to
another worksheet?

The hardiest problem I am having is finding the syntax I need to use.

Thanks!


--

Dave Peterson