PDA

View Full Version : Problem with printing data from sheet to another



Nader
01-29-2008, 07:53 AM
Step1: I tried this code to print the data from the "sheet1" to the "bills" sheet and it print the data in gorup ( rwos) one after one, and when I delet all the group data and try again the code it start from the first rows where it start in the first realse


Dim myRange1 As Range, myRange2 As Range, myRange3 As Range, myRange4 As Range
Dim j As Integer

Set myRange1 = Sheets(1).Range("A24:A1000")
Set myRange2 = Sheets(1).Range("B24:B100")
Set myRange3 = Sheets(1).Range("C24:A1000")
Set myRange4 = Sheets(1).Range("D24:B100")


j = Sheets("Bills").UsedRange.Rows.Count + 1 + Sheets("Bills").UsedRange.Row

myRange1.Copy Sheets("Bills").Range("a" & j)
myRange2.Copy Sheets("Bills").Range("b" & j)
myRange3.Copy Sheets("Bills").Range("c" & j)
myRange4.Copy Sheets("Bills").Range("d" & j)

Step2: I added another similar code to the same project to print more data, but when I delet all the data it didn't start from the first rows where it start in the first realse. It starts for the last data and each time I delet all data it starts from the last rows.

Step3: so I delet the last code that I added and now it doesn't any data

here are the project in each three steps (excel files)