Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / February 2006

Tip: Looking for answers? Try searching our database.

Copy, delete and printing in 1step

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nordscan - 10 Feb 2006 12:32 GMT
Hi all,

I have a question, if is this possible:

in worksheet3
copy D27 - D40 in B27 - B40
delete d27 - D40 the cells move left

print worksheet 1 -4x
print worksheet 2 -1x

and all this repeat unti D27 is empty /cca 140x/

thnx

Signature

nordscan

Dave Peterson - 10 Feb 2006 14:39 GMT
I used print preview, but you can change this after you test.

Option Explicit
Sub testme01()

   Dim wks1 As Worksheet
   Dim wks2 As Worksheet
   Dim wks3 As Worksheet
   Dim AddrToCopy As String
   Dim AddrToPaste As String
   
   Set wks1 = Worksheets("sheet1")
   Set wks2 = Worksheets("sheet2")
   Set wks3 = Worksheets("sheet3")
   
   AddrToCopy = "D27:d40"
   AddrToPaste = "B27"
   
   With wks3
       Do
           If .Range(AddrToCopy).Cells(1).Value = "" Then
               Exit Do
           End If
           .Range(AddrToCopy).Copy _
               Destination:=.Range(AddrToPaste)
           .Range(AddrToCopy).Delete shift:=xlToLeft
           wks1.PrintOut copies:=4, preview:=True
           wks2.PrintOut copies:=1, preview:=True
       Loop
   End With
End Sub

> Hi all,
>
[quoted text clipped - 16 lines]
> nordscan's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=31136
> View this thread: http://www.excelforum.com/showthread.php?threadid=511000

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.