View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default copying and pasting from source sheet to destination sheet without naming source sht?

Hi Simon,

I'm not sure that you'd need to name all your sheets. As long as Statistics
and New Stats are named, you can use ActiveSheet for the others.

So in my example, try changing this line:

Set wsSource = Worksheets("Sheet1")

To this:

Set wsSource = ActiveSheet

That way, you'll always be working from the current sheet. Does that work?

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]


Simon Lloyd wrote:
Thanks for the worked example Jake, it looks good but the problem
that i am trying to work around is that i have 12 (not 8!) different
sheets that would need to call on that procedure but do the copying
and pasting from the sheet that originated it and then end back at
that sheet, so by your example it seems that i would still have to
name all the sheets and (because my knowledge is limited!) i think it
would become a very complex piece of coding and i dont think i am up
to that, all i wanted to do is shrink the code in my workbook because
i have had to duplicate code but change the sheet names that would
call it.

Thats probably as clear as mud to you! guess i'm poor at explaining
what i want as well as devising what i need haha!

Regards,
Simon