Hello everyone.
I need help with a macro. In this Macro, the user is prompted to CHOOSE a workbook file ( a version of ”Vendor Dec Sheet”) from his/her desktop folder (it is not necessary to actually open the file, but information in a certain range of this SOURCE workbook (“Fiber” tab, range F9:AR193) is copied and pasted to a DESTINATION workbook that is an always-open template.
The DESTINATION workbook's range for the initial paste will be in column C (also “Fiber” tab), offset one row down from the last row already occupied.
The selected SOURCE workbook also has a “Cover Page” tab where the vendor’s name (in Cell C6) is copied then pasted in the DESTINATION workbook, Cell B6, beside (to the left of) every row of data that was just pasted in the previous step (and only in those rows).
So far, I have this (the "primary" macro): ...
Sub Get_Data_from_File()
Dim FileToOpen As Variant
Dim openbook As Workbook
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your file & Click/Select it", ButtonText:="Choose Supplier Dec Sheet that You Saved")
',FileFilter:="Excel Files ( .*XLS*), *XLS*")
If FileToOpen <> False Then
Set openbook = Application.Workbooks.Open(FileToOpen)
openbook.Sheets("Fiber Components").Range("F9:AR193").Copy
ThisWorkbook.Worksheets("Fiber data").Range("c8").PasteSpecial xlPasteValues
openbook.Sheets("Plastic Components").Range("B9:X193").Copy
ThisWorkbook.Worksheets("Plastics data").Range("c8").PasteSpecial xlPasteValues
openbook.Sheets("Foam Components (EPE, EPU, EPS)").Range("B9:W193").Copy
ThisWorkbook.Worksheets("Plastic Foam data").Range("c8").PasteSpecial xlPasteValues
openbook.Close False
End If
Application.ScreenUpdating = True
End Sub
...plus another macro to copy and fill down the supplier's name-- eventually wanting to combine the two into one button.
Thx,
Turk182
I need help with a macro. In this Macro, the user is prompted to CHOOSE a workbook file ( a version of ”Vendor Dec Sheet”) from his/her desktop folder (it is not necessary to actually open the file, but information in a certain range of this SOURCE workbook (“Fiber” tab, range F9:AR193) is copied and pasted to a DESTINATION workbook that is an always-open template.
The DESTINATION workbook's range for the initial paste will be in column C (also “Fiber” tab), offset one row down from the last row already occupied.
The selected SOURCE workbook also has a “Cover Page” tab where the vendor’s name (in Cell C6) is copied then pasted in the DESTINATION workbook, Cell B6, beside (to the left of) every row of data that was just pasted in the previous step (and only in those rows).
So far, I have this (the "primary" macro): ...
Sub Get_Data_from_File()
Dim FileToOpen As Variant
Dim openbook As Workbook
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your file & Click/Select it", ButtonText:="Choose Supplier Dec Sheet that You Saved")
',FileFilter:="Excel Files ( .*XLS*), *XLS*")
If FileToOpen <> False Then
Set openbook = Application.Workbooks.Open(FileToOpen)
openbook.Sheets("Fiber Components").Range("F9:AR193").Copy
ThisWorkbook.Worksheets("Fiber data").Range("c8").PasteSpecial xlPasteValues
openbook.Sheets("Plastic Components").Range("B9:X193").Copy
ThisWorkbook.Worksheets("Plastics data").Range("c8").PasteSpecial xlPasteValues
openbook.Sheets("Foam Components (EPE, EPU, EPS)").Range("B9:W193").Copy
ThisWorkbook.Worksheets("Plastic Foam data").Range("c8").PasteSpecial xlPasteValues
openbook.Close False
End If
Application.ScreenUpdating = True
End Sub
...plus another macro to copy and fill down the supplier's name-- eventually wanting to combine the two into one button.
Thx,
Turk182