i have problem that i think it is not easy to solve(maybe not,but i think it is so hard :wink: ) ,i have a 2sheet(shhet9 and sheet10) and a user form,i put command button on userform for printing the special area of sheet10,data should copy from sheet 9 to sheet 10 by step 1row by 1row then print the area of sheet10 and copy next row and continue this proces until last row in sheet9.
i find way for do it but it is just work for some steps(i mean that i should right code for it each time),if anyboady can pleas help me for make it by excell
and this is my code :
Private Sub CommandButton11_Click()
Sheet9.Activate
If Sheet9.Range("A2").Value = "" Then
MsgBox "you did not press the insert data button"
Sheet9.Activate
Range("A:A").Select
Selection.ClearContents
Exit Sub
Else
Sheet10.Range("I1").Value = Sheet9.Range("A2")
End If
Sheet10.Activate
Range("A4:M78").Select
With ActiveSheet.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,1,,,TRUE,,FALSE)"
Application.Wait (Now + TimeValue("0:00:1"))
If Sheet9.Range("A3").Value = "" Then
MsgBox "printing done"
Exit Sub
Else
Sheet10.Range("I1").Value = Sheet9.Range("A3")
End If
Sheet10.Activate
Range("A4:M78").Select
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,1,,,TRUE,,FALSE)"
Application.Wait (Now + TimeValue("0:00:1"))
If Sheet9.Range("A4").Value = "" Then
MsgBox "you did not press the insert data button"
Exit Sub
Else
Sheet10.Range("I1").Value = Sheet9.Range("A4")
End If
Sheet10.Activate
Range("A4:M78").Select
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,1,,,TRUE,,FALSE)"
Application.Wait (Now + TimeValue("0:00:1"))
If Sheet9.Range("A5").Value = "" Then
MsgBox "printing done"
Exit Sub
.
.
.
.
.
continue....