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: 3
Default On Error GoTo

I am using an On Error GoTo statement within a loop, however, the On Error GoTo statement only works once when crossed in the loop. Is there a way around this?

My code is:
Do Until acounter = ActiveWorkbook.Sheets.Count
sales = -Range("B14").Value
gp = -Range("B23").Value
cp = -Range("B47").Value
store = Left(Right(ActiveSheet.Name, 6), 5)
Windows(zfile).Activate
Sheets("Post Project Financials").Select
On Error GoTo sheet2
Cells.Find(What:=store, After:=ActiveCell, LookIn:=xlValues,LookAt:=
xlWhole,SearchOrder:=xlByRows,SearchDirection:=xlN ext,MatchCase:=False)
.Activate
storerange = ActiveCell.Address
sheetresume:
Range(storerange).Select
Selection.Offset(0, 7).Activate
ActiveCell.Value = sales

acounter = acounter + 1
Windows(afile).Activate
ActiveSheet.Next.Select
Loop

Exit Sub
sheet2:
Sheets("Post Project Financials (2)").Select
Cells.Find(What:=store, After:=ActiveCell, LookIn:=xlValues,LookAt:=
xlWhole,SearchOrder:=xlByRows,SearchDirection:=xlN ext,MatchCase:=False)
.Activate
storerange = ActiveCell.Address
GoTo sheetresume

 
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
Meaning of On Error Goto 0 FARAZ QURESHI Excel Discussion (Misc queries) 5 May 4th 09 12:43 PM
On error goto problem Coppercrutch Excel Discussion (Misc queries) 3 December 28th 07 03:04 PM
How can I still go to the error-code after a On Error Goto? Michel[_3_] Excel Programming 2 May 4th 04 04:21 AM
On error goto 0? Brian Tozer Excel Programming 10 December 29th 03 09:59 PM
On error goto 0 David Excel Programming 2 November 18th 03 01:43 PM


All times are GMT +1. The time now is 11:49 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"