Nader
02-24-2008, 06:35 AM
I tried this code to copy the data form sheet1 to material sheet
But if the format of sheet1( font, size of font ..etc) is different between sheet1 and
Material the code doesn't work well . It left many rows between the data in Material sheet.How to fix this problem
Dim myRange As Range
Dim R As Long
Dim cell As Range
Set myRange = Worksheets("sheet1").Range("A1:A100") '??????
For Each cell In myRange
R = Sheets("Material").UsedRange.Rows.Count
If R <> 1 Or Sheets("Material").Range("A1").Value <> "" Then R = R + 1
cell.Resize(, 8).Copy Sheets("Material").Range("a" & R)
Next cell
But if the format of sheet1( font, size of font ..etc) is different between sheet1 and
Material the code doesn't work well . It left many rows between the data in Material sheet.How to fix this problem
Dim myRange As Range
Dim R As Long
Dim cell As Range
Set myRange = Worksheets("sheet1").Range("A1:A100") '??????
For Each cell In myRange
R = Sheets("Material").UsedRange.Rows.Count
If R <> 1 Or Sheets("Material").Range("A1").Value <> "" Then R = R + 1
cell.Resize(, 8).Copy Sheets("Material").Range("a" & R)
Next cell