View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Ramage[_2_] Dave Ramage[_2_] is offline
external usenet poster
 
Posts: 41
Default Copying data to another worksheet gives "Type Mismatch" error

So you don't have the Type Mismatch error after changing
Rows to Row?

Not sure what code you are using for the C10 through C16
bit- post the code section and I'd be happy to take a
look...

Cheers,
Dave.
-----Original Message-----
Thanks Dave. I had already tried that. The problem was

that I'm doing the
routine for a range of data (cells C10 through C16). The

problem I kept
coming up with was that the first set of data transferred

OK, but the second
set (from C11) caused a double entry (one from C10 again,

and one from C11).
A third set entered three sets of data... and so on. What

seemed so simple
has turned out to be a major headache. Any ideas?

"Dave Ramage" wrote in message
...
Range("B65536").End(xlUp).Rows returns a range object
consisting of the first non-blank cell from the bottom

of
column B.

What you need is Range("B65536").End(xlUp).Row, which

will
return the row number of that cell.

One letter can make all the difference!

For info, a better method may be:
Sheets("ws2").Range("B65536").End(xlUp).Offset

(1,0).Value
= vHours

Cheers,
Dave.
-----Original Message-----
I am trying to copy data from one worksheet to another,

but I keep getting a
"Type Mismatch" (error 13) message. I've tried a bunch

of
different ways to
code this, but I end up with the same error every time.

In desperation, the
following was the last attempt:

Dim vHours as Integer
Dim vdate as Date

If Range("C10").Value 0 Then
vHours = Range("C10").Value
vDate = Range("G5").Value - 6
Sheets("ws2").Range("B" & Range("B65536").End

(xlUp).Rows + 1).Value =
vHours
Sheets("ws2").Range("A" & Range("A65536").End

(xlUp).Rows + 1).Value =
vDate
End If

What am I missing? This is driving me crazy. HELP!!!


.



.