Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Die_Another_Day wrote: 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 I put it inside a with statement and deleted the "wsExtrFrom" after the = sign, and it ran! Don't think I'll ever figure out why or when it does that. Thanks for the help! 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. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With wsExtFrom
Set rCopy = .Range(.Cells(lCopyRow, lExtrFromCol), _ .Cells(lCopyRow, lExtrToCol)) End with msgbox rcopy.Address(0,0,xla1,true) -- Regards, Tom Ogilvy "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. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Tom Ogilvy wrote: With wsExtFrom Set rCopy = .Range(.Cells(lCopyRow, lExtrFromCol), _ .Cells(lCopyRow, lExtrToCol)) End with msgbox rcopy.Address(0,0,xla1,true) Sorry, Tom, didn't see your reply until today. Got the with statement needing to be there. What is the "msgbox rcopy.address(0,0,xla1, true) for? -- Regards, Tom Ogilvy "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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
to sum the quantity of only applicable for last 7 days from today | Excel Discussion (Misc queries) | |||
Find Applicable Formula, then Use It | Excel Worksheet Functions | |||
Splitting cells using formula; RIGHT/LEFT not applicable | Excel Worksheet Functions | |||
VBA Problem - How to collect and display text information from applicable cells. | Excel Programming | |||
How mk code applicable to any active workbook? | Excel Programming |