Hi All,
I have a range of "Id's" in one worksheet (A4:A18) that I'd like to loop through and copy each and paste the values into cell G4 of another worksheet. The cells on that worksheet would then update based on the new ID. From there I want to save a copy of the workbook that will include that ID and the cell above it which is a name. Super new but eager to keep learning.
I have a range of "Id's" in one worksheet (A4:A18) that I'd like to loop through and copy each and paste the values into cell G4 of another worksheet. The cells on that worksheet would then update based on the new ID. From there I want to save a copy of the workbook that will include that ID and the cell above it which is a name. Super new but eager to keep learning.
VBA Code:
Sub Save_Copy_File()
Dim ID As Range
Dim srcWS As Worksheet
Dim LastRow As Long
Dim Filename As String
Dim Path As String
Application.ScreenUpdating = False
Path = "\\this is where i want the file saved"
Set Filename = Worksheets("TP").Range("G3").Value
Set srcWS = Sheets("TD")
LastRow = srcWS.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For Each ID In srcWS.Range("A4:A18")
Sheets("TD").Range("A4").Copy
Sheets("TP").Range("G4").PasteSpecial Paste:=xlPasteValues
ActiveWorkbook.SaveCopyAs Filename:=Path & ID & "_" & Filename & "_4.30.20 FYE Pro" & ".xlsm"
Next ID
Application.ScreenUpdating = True
End Sub