Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Run-time error '91': "Object variable or With block variable not set in
the following code" occurs on the following line: ..Find(What:="*/*/04", After:=ActiveCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Activate I don't know why...can someone help??? The code is shown below. Thanks In Advance, Mike Taylor Option Explicit Sub TestCopyTo2005() Dim rDest As Range Dim rSource As Range Dim Ssh As Worksheet Dim Dsh As Worksheet Set Ssh = ThisWorkbook.Sheets("Revenue-Client Data Entry") Set Dsh = Workbooks("2005.xls").Sheets("Revenue-Client Data Entry") With Workbooks("2004.xls").Worksheets("Revenue-Client Data Entry").Range("B4:AJ305") ..Select ..Sort Key1:=Range("B4"), _ Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom 'Code errors on the following line: ..Find(What:="*/*/04", After:=ActiveCell, LookIn:=xlValues, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False).Activate End With Set rSource = Range(ActiveCell, Range("AJ305")) Set rDest = Workbooks("2005.xls").Sheets("Revenue-Client Data _ Entry").Range("B4") rSource.Copy rDest End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
Error 91 -- Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming | |||
"Run-time error 91: Object variable or With block not set" | Excel Programming | |||
Error 91 - Object variable with block variable not set | Excel Programming |