Hello,
First of all sorry my bad english...
From The Workbook "Parts List.xlsm" can be found in the Worksheet "Parts" and there is a parts list defined in the A2: H20 area, which should make the VBA move to another Workbook (Parts.xlsx) one below the other.
The code I made now moves the cells that are "empty" and the next copy moves after the first move to the cell A39 and the next to A59 etc .....
What is wrong with that or does this also take empty cells where are formulas only in the range A2: H20?
How can I fix this?
Thank you in advance!
First of all sorry my bad english...
From The Workbook "Parts List.xlsm" can be found in the Worksheet "Parts" and there is a parts list defined in the A2: H20 area, which should make the VBA move to another Workbook (Parts.xlsx) one below the other.
The code I made now moves the cells that are "empty" and the next copy moves after the first move to the cell A39 and the next to A59 etc .....
What is wrong with that or does this also take empty cells where are formulas only in the range A2: H20?
How can I fix this?
Thank you in advance!
VBA Code:
Sub Parts_list()
Dim wbGood As Workbook
Dim wsCopy As Worksheet, wsDest As Worksheet
Dim lCopyLastRow As Long, lDestLastRow As Long
Set wbGood = Workbooks("Partslist.xlsm")
Set wbGood = Workbooks("Parts.xlsx")
Set wsCopy = Workbooks("Partslist.xlsm").Worksheets("Parts")
Set wsDest = Workbooks("Parts.xlsx").Worksheets("Taul1")
lCopyLastRow = wsCopy.Cells(wsCopy.Rows.Count, "A").End(xlUp).Row
lDestLastRow = wsDest.Cells(wsDest.Rows.Count, "A").End(xlUp).Offset(1).Row
wsCopy.Range("A2:H" & lCopyLastRow).Copy
wsDest.Range("A" & lDestLastRow).PasteSpecial xlValues
Application.CutCopyMode = False
End Sub