Nader
01-03-2008, 10:01 PM
In the first my english language isn't very well so I use the pic to explain waht I want
I use this code to print the data in sheet2 . Every command print a new group data ( here data has two rows and may be can take more rows).
Private Sub CommandButton1_Click()
Dim myRange1 As Range
Dim myRange2 As Range
Dim j As Integer
Set myRange1 = Sheets(1).Range("A6:A100")
Set myRange2 = Sheets(1).Range("B6:B100")
j = Sheets(2).UsedRange.Rows.Count + 3 + Sheets(2).UsedRange.Row
myRange1.Copy Sheets(2).Range("f" & j)
myRange2.Copy Sheets(2).Range("g" & j)
End Sub
I want to add a new code to my last code to complete this process:
In the first relase this code will print group1 in sheet2 and same way in sheet3,4. In the second relase it will print the second group in the sheet2 and I want to add the number (3, of mydata to the cells of sheet3,4 ) not by print them as group and etc..
I use this code to print the data in sheet2 . Every command print a new group data ( here data has two rows and may be can take more rows).
Private Sub CommandButton1_Click()
Dim myRange1 As Range
Dim myRange2 As Range
Dim j As Integer
Set myRange1 = Sheets(1).Range("A6:A100")
Set myRange2 = Sheets(1).Range("B6:B100")
j = Sheets(2).UsedRange.Rows.Count + 3 + Sheets(2).UsedRange.Row
myRange1.Copy Sheets(2).Range("f" & j)
myRange2.Copy Sheets(2).Range("g" & j)
End Sub
I want to add a new code to my last code to complete this process:
In the first relase this code will print group1 in sheet2 and same way in sheet3,4. In the second relase it will print the second group in the sheet2 and I want to add the number (3, of mydata to the cells of sheet3,4 ) not by print them as group and etc..