robsimkins
Technical User
HI guys, hope all are well, I'm looking for help on a sub which moves part lists from each product sheet into a single sheet for import to our stock system. Just need to know how to Dim my worksheets to loop thru the Wkbk?
TIA for anyone who helps!
- Rob
Sub move_parts()
Dim Endcell, Startcell As Range
Dim wksht As Worksheet //<-- wrong??
Workbooks("Airware_Portfolio.xls").Activate
For Each wksht In Application.ActiveWorkbook //<-- error
Set Startcell = Range("A2")
Set Endcell = Range("H:H").Find(What:="*", LookIn:=xlValues, SearchDirection:=xlPrevious)
Range(Startcell, Endcell).Copy
Workbooks("Airware_part_list.xls").Activate
Worksheets("Full_list").Activate
Range("A2").Insert shift:=xlShiftDown
Workbooks("Airware_Portfolio.xls").Activate
Next wksht
Columns("A:H").EntireColumn.AutoFit
ActiveWorkbook.Save
End Sub
TIA for anyone who helps!
- Rob
Sub move_parts()
Dim Endcell, Startcell As Range
Dim wksht As Worksheet //<-- wrong??
Workbooks("Airware_Portfolio.xls").Activate
For Each wksht In Application.ActiveWorkbook //<-- error
Set Startcell = Range("A2")
Set Endcell = Range("H:H").Find(What:="*", LookIn:=xlValues, SearchDirection:=xlPrevious)
Range(Startcell, Endcell).Copy
Workbooks("Airware_part_list.xls").Activate
Worksheets("Full_list").Activate
Range("A2").Insert shift:=xlShiftDown
Workbooks("Airware_Portfolio.xls").Activate
Next wksht
Columns("A:H").EntireColumn.AutoFit
ActiveWorkbook.Save
End Sub