View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
asburypark98 asburypark98 is offline
external usenet poster
 
Posts: 4
Default "passing" variable trough routine

hi Tom,
thank you for your reply.
It works; but I write this code because in my work
I want to bring both the two ranges in the other routine.
If I use the "select" command, routine remember only the last
range and not the previous.
So how can I bring both ranges from the Sub FindRange() to the
Sub ref() routine ?

regards,
ap98


"Tom Ogilvy" wrote:

Sub ref()
Range("A1").Copy
Range("A1").End(xltoRight)(1,2).PasteSpecial xlValues
Range("A1").End(xldown)(2).PasteSpecial xlValues
End sub

would paste in C1 and A5.

--
Regards,
Tom Ogilvy