Good Afternoon,
Hoping for some help here, I clearly don't know what I am doing.
Here is the goal: To update my master spread sheet.
I am trying to implement a new project tracker, this will be an excel sheet, named exactly the same thing, for EVERY job.
It has a table in it on a hidden sheet.
Hidden sheet name: MasterTrackerLink
Table Name: MTLink
It only has one set of data and headers, starting in A1 (data is on A2)
My master workbook has a sheet called "Active"
That has the file paths to the workbooks that I would want to open, it also has 0s in the same row, if I am not trying to get that data.
Example:
This is Column O starting at O1
My master workbook has another sheet called "Tracker Link" That the A2 data from the project trackers will need to be pasted (as values)
I would need a code to go through this list,
open up the project workbook (ideally with out it popping up for the user)
unhide the sheet, copy the data
paste the data on the master,
and then close the project workbook. (Doesnt need to save)
Here is what I tryed to make, based off google, and recording Macros.
This does not work at all, I only get errors, I don't know what I am doing.
Please Help
Thank you
Hoping for some help here, I clearly don't know what I am doing.
Here is the goal: To update my master spread sheet.
I am trying to implement a new project tracker, this will be an excel sheet, named exactly the same thing, for EVERY job.
It has a table in it on a hidden sheet.
Hidden sheet name: MasterTrackerLink
Table Name: MTLink
It only has one set of data and headers, starting in A1 (data is on A2)
My master workbook has a sheet called "Active"
That has the file paths to the workbooks that I would want to open, it also has 0s in the same row, if I am not trying to get that data.
Example:
This is Column O starting at O1
0 |
L:\Projects\Service\Service Active\1564 - Folder Name\Weekly PM Folder\Project Tracker.xlsm |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
L:\Projects\Service\Service Active\1555 - Folder Name\Weekly PM Folder\Project Tracker.xlsm |
0 |
0 |
0 |
0 |
0 |
L:\Projects\Active\1549 - Folder Name\Weekly PM Folder\Project Tracker.xlsm |
0 |
My master workbook has another sheet called "Tracker Link" That the A2 data from the project trackers will need to be pasted (as values)
I would need a code to go through this list,
open up the project workbook (ideally with out it popping up for the user)
unhide the sheet, copy the data
paste the data on the master,
and then close the project workbook. (Doesnt need to save)
Here is what I tryed to make, based off google, and recording Macros.
VBA Code:
Sub UpdateJobs()
Dim sh As Worksheet
Sheets("Master Cover Sheet").Select
Range("A1").Select
Sheets("Tracker Link").Visible = True
Sheets("Active").Visible = True
Sheets("Active").Select
Columns("N:N").Select
Selection.Copy
Columns("O:O").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Set Rng = Range("O1" & Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row)
For i = Rng.Cells.Count To 1 Step -1
If Rng(i).Value <> 0 Then
Set sh = GetObject(Rng(i).Value).Worksheets("MasterTrackerLink")
Sheets("MasterTrackerLink").Visible = True
Sheets("TrackerLink").Select
Range("A2:L2").Select
Sheets("Tracker Link").Select
Rows("2:2").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Windows("Project Tracker.xlsm").Activate
Range("MTLink").Select
Selection.Copy
Windows("Master Tracker.xlsm").Activate
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' your codes here
sh.Parent.Close SaveChanges:=False 'Closes the associated workbook
Next i
End If
End Sub
This does not work at all, I only get errors, I don't know what I am doing.
Please Help
Thank you