Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default code back to worksheet

I have written some code which goes through a series of worksheets which are
all the same except the name is different peoples intials. The code opens
each sheet and highlights the errors, I am trying to copy these errors into a
summary/report sheet. The code goes through each row and when it finds an
error jumps into the copying sub.

I have got the code copying the errors into a report template sheet but
can't get the code to jump back into the previously active worksheet, where
the data/errors have been copied from to carry on looking for more errors and
go through other sheets.

once it finds an error... (i know there's errors in the code only rough/
quick)

Range("A" & i : "L" & i).select
Copy.selecction
Call report

sheets("summary").select
-code to find the last row-
paste.selection
-now go back to last active sheet???-

Any help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default code back to worksheet

Use a separate procedure to write the summary and pass the activesheet as an
argument like shown below...I have used your code only...Please try and
feedback

Sub <YourProcedure
' check
Range("A" & i : "L" & i).select
Copy.selecction
Call WriteSummary(ActiveSheet)
'continue
End Sub


Sub WriteSummary(wsTemp as Worksheet)
'Procedure to write to summary. Source sheet passed as argument
Sheets("summary").select
-code to find the last row-
Paste.selection
-now go back to last active sheet???-
wsTemp.Activate
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"project manager" wrote:

I have written some code which goes through a series of worksheets which are
all the same except the name is different peoples intials. The code opens
each sheet and highlights the errors, I am trying to copy these errors into a
summary/report sheet. The code goes through each row and when it finds an
error jumps into the copying sub.

I have got the code copying the errors into a report template sheet but
can't get the code to jump back into the previously active worksheet, where
the data/errors have been copied from to carry on looking for more errors and
go through other sheets.

once it finds an error... (i know there's errors in the code only rough/
quick)

Range("A" & i : "L" & i).select
Copy.selecction
Call report

sheets("summary").select
-code to find the last row-
paste.selection
-now go back to last active sheet???-

Any help?

Reply
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
code back to worksheet Don Guillett Excel Programming 0 May 1st 09 09:12 PM
Print worksheet 2 on back of worksheet 1, etc.... Lenny Excel Discussion (Misc queries) 1 February 13th 09 11:07 PM
importing back code modules joeycalisay Excel Programming 2 January 31st 07 01:33 PM
excel 2002 wont accept my code on back of disk racer New Users to Excel 1 December 6th 05 11:56 AM
code to strip back (from the right) a directory but not the file name chrissie frisbee Excel Programming 2 September 4th 03 12:33 PM


All times are GMT +1. The time now is 07:01 AM.

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

About Us

"It's about Microsoft Excel"