LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default method range failed

I'm getting a "method range of object worksheet failed" error at the
line marked:

Set rStart = Range("B4")
lRow = rStart.End(xlDown).Row - 1

Set rCty = Range(rStart, Cells(lRow, "B"))


Call ColUnHideAll

Set wkshtSource = ActiveSheet

Set wkshtNew = Workbooks.Add.Sheets("sheet1")

rCty.Copy Destination:= _
wkshtNew.Range("A2")

Set rTopCell = wkshtSource.Range("3:3").Find("top", LookIn:=xlValues,
lookat:=xlPart)
If Not rTopCell Is Nothing Then
lColTop = rTopCell.Column
lStartRow = rTopCell.Row + 1
End If

Set rCtySts = wkshtSource.Range(Cells(lStartRow, lColTop), Cells(lRow,
lColTop + 1))<------ERROR

rCtySts.Copy Destination:=wkshtNew.Range("B2")

End Sub

A couple of lines above, method range of the same worksheet worked
fine. So what's wrong with having another range of the same worksheet?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
select method of range class failed Joseph[_38_] Excel Programming 1 September 28th 04 03:21 PM
Method 'Range' of Object_Worksheet Failed Excel-erate2004[_21_] Excel Programming 23 September 2nd 04 05:49 AM
HELP!!!! -- (Method Range of _Worksheet failed) ERROR! Fusion[_2_] Excel Programming 4 November 24th 03 03:32 PM
Method 'Range' of object '_Global' failed Mohanasundaram[_2_] Excel Programming 1 August 25th 03 01:43 PM


All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"