View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default Range - Application Defined or Object Defined Error

It could be a problem with the resolution of cells. You do not specify the
worksheet when you make the reference. Try something like this...

with ThisWorkbook.Worksheets("Procedures").
Set myRange2 = .Range(.Cells(TotalNames + 3, 1), .Cells(TotalNames + 3, 2))
end with

--
HTH...

Jim Thomlinson


"Dyl" wrote:

Hello,

I am having a problem with declaring a range object. The code which I
receive the Application/Object Defined error for is

Set myRange2 =
ThisWorkbook.Worksheets("Procedures").Range(Cells( TotalNames + 3, 1),
Cells(TotalNames + 3, 2))

I am frustrated because I have a line of code in my program which does
work and is almost identical.

Set myRange = ThisWorkbook.Worksheets("Procedures").Range(Cells( 2,
NumberofBuilds + 2), Cells(3, NumberofBuilds + 2))



I am unclear of how to use Range syntax, but I am comfortable referring
to cells using cell index numbers. Any help or reccomendations would
be appreciated.

Thanks for your time.

Dylan H