Hi Mumps
I have had to change the location of the reference file F100 Tracker to a new location, How do i edit the VBA and links as i don't seam to be able to edit the link and it save the new location. The F100 Tracking File will now be in a different location than the invoice tracking sheet. Will i need to change the whole script to do this?
attached id the script you did with a few slight tweaks for extra information that i needed to capture and a layout change i made.
Private Sub CommandButton1_Click()
Sub OpenF100Tracking()
Dim desWS As Worksheet
Set desWS = ThisWorkbook.ActiveSheet
Workbooks.Open ThisWorkbook.Path & "\" & "F100 Tracking.xlsx"
desWS.Activate
End Sub
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("C5, G5, K5, O5, S5, W5")) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Dim srcWB As Workbook, desWS As Worksheet, ws As Worksheet, fnd As Range
Set srcWB = Workbooks("F100 Tracking.xlsx")
Set desWS = ThisWorkbook.ActiveSheet
For Each ws In srcWB.Sheets
Set fnd = ws.Range("C5, C32 ,H5,H32,M5,M32").Find(Target.Value, LookIn:=xlValues, lookat:=xlWhole)
If Not fnd Is Nothing Then
fnd.Offset(3, -1).Resize(21, 4).Copy Target.Offset(2, -1)
Target.Offset(25, 1) = fnd.Offset(1)
Target.Offset(24, 1) = fnd.Offset(, 2)
Target.Offset(26, 1) = fnd.Offset(1, 2)
Target.Offset(-1, 0) = fnd.Offset(-1, 0)
End If
Next ws
Application.ScreenUpdating = True
End Sub