View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Die_Another_Day Die_Another_Day is offline
external usenet poster
 
Posts: 644
Default .cells not applicable to range

You are not in a with statement as far as I can see, and might not have
that page activated, so try this:
Set rCopy = wsExtFrom.Range(wsExtFrom.Cells(lCopyRow, lExtrFromCol), _
wsExtFrom.Cells(lCopyRow, lExtrToCol))

HTH

Charles Chickering

davegb wrote:
I've been fooling with this line of code for over an hour. For some
reason, VBA won't accept ".cells" as a property or method or event of
.range today. Getting a "method range of object worksheet failed"
error. Any ideas? VBA help doesn't even recognize "cells" at all, so no
help there. But it is in the Object Browser shown as being ok with a
range and a range being ok with a worksheet.

Set rCopy = wsExtFrom.Range(.Cells(lCopyRow, lExtrFromCol),
.Cells(lCopyRow, lExtrToCol))

I've tried it with and without the periods in front of "cells".

All of the variables show in the "list" of applicable variables. I'm
stumped, again.

Thanks in advance.