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: 1
Default copying and pasting from source sheet to destination sheet without naming source sht?


Hi all, Below is a portion of quite a long section of code, it's like
this because i am copying and pasting to another sheet (Statistics) and
then going back to my original page (New Stats) copying...etc, I have 8
of these very long pieces of code because the exact same procedure is
used by the other sheets but when it returns to a sheet to copy of
course it has to return to the sheet the data is being copied
from.....Is there anyway i code narrow it down to one piece of code
that remembers which sheet it was on originally before opening
"Statistics" or do i have to stick with having a seperate one for each
sheet???

Regards,
Simon

Sub Stats()
Application.ScreenUpdating = False
Range("B1").Select
Selection.Copy
Sheets("Statistics").Visible = True
Sheets("Statistics").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Sheets("New Stats").Select
ActiveCell.Offset(2, 0).Range("A1").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Statistics").Select
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Sheets("New Stats").Select
...............etc, And so on...!


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=547555

 
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
copied formulas refer to destination sheet not source sheet Dantron Excel Worksheet Functions 2 October 21st 09 09:51 PM
sort source data sheet while destination shows same data Inobugs Excel Worksheet Functions 1 April 18th 09 09:36 PM
Always keeping source formatting when copying and pasting in Excel Mail Merge and Form Protection in Word 2 Excel Worksheet Functions 0 February 13th 07 02:54 PM
How to copy a sheet and rename it with the value of two cells from the source sheet? Simon Lloyd[_717_] Excel Programming 0 May 12th 06 01:31 AM
Hyperlinks - identifying source in destination sheet UniDave Excel Discussion (Misc queries) 0 November 25th 04 10:07 PM


All times are GMT +1. The time now is 02:19 AM.

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"