Five year old thread so I suspect the mana is notgoing to see it. Usually it's better to start a new one, and just reference the old one
Anyways, try this. I couldn't test it but an eyeball check looks good
Option Explicit Sub test3() Dim s As String Dim f As String Dim MachID As String s = "PRO123456" MachID = "ABCD1234" f = "=Iferror(match(""" & s & """,'Q:\KUNDER\PROJEKTER\HPG\[HPG_DB.xlsx]" & MachID & "'!$A:$A,0),""not found"")" Debug.Print f End Sub