Emoncada
01-29-2008, 01:04 PM
I have this Kill vb that I use but would like to know if I can have it in a If Statement.
Kill ("S:\Equipment Tracking\WIP\" & Range("K3").Value & "\" & Range("K5").Value & "\" & Range("B6").Value & ".xls")
So I would like for it to locate the file first If it's not in that "WIP" Folder To look for it In the ("S:\Equipment Tracking\Available") Folder.
Or have it test a range of cells to know in which folder it's in.
If
Test Range ("J27") If = "Available" then Look in Available Folder.
ElseIF
Test Range ("J27") If = "Retire" then Look in Retire Folder.
ElseIF
Test Range ("J27") If = Anything other than "Retire","Available", "" then Look in WIP Folder.
ElseIF
Test Range ("J27") If = "" then Go To Next Range
ElseIF
Test Range ("J23") If = "Available" then Look in Available Folder.
ElseIF
Test Range ("J23") If = "Retire" then Look in Available Folder.
ElseIF
Test Range ("J23") If = Anything other than "Retire","Available", "" then Look in WIP Folder.
ElseIF
Test Range ("J23") If = "" then Go To Next Range.
ElseIF
Test Range ("J19") If = "Available" then Look in Available Folder.
ElseIF
Test Range ("J19") If = "Retire" then Look in Available Folder.
ElseIF
Test Range ("J19") If = Anything other than "Retire","Available", "" then Look in WIP Folder.
ElseIF
Test Range ("J19") If = "" then Go To Next Range.
ElseIF
Test Range ("J15") If = "Available" then Look in Available Folder.
ElseIF
Test Range ("J15") If = "Retire" then Look in Available Folder.
ElseIF
Test Range ("J15") If = Anything other than "Retire","Available", "" then Look in WIP Folder.
ElseIF
Test Range ("J15") If = "" then Go To Next Range.
ElseIF
Test Range ("J11") If = "Available" then Look in Available Folder.
ElseIF
Test Range ("J11") If = "Retire" then Look in Available Folder.
ElseIF
Test Range ("J11") If = Anything other than "Retire","Available", "" then Look in WIP Folder.
ElseIF
Test Range ("J11") If = "" then
End Sub
How can I do this.
Kill ("S:\Equipment Tracking\WIP\" & Range("K3").Value & "\" & Range("K5").Value & "\" & Range("B6").Value & ".xls")
So I would like for it to locate the file first If it's not in that "WIP" Folder To look for it In the ("S:\Equipment Tracking\Available") Folder.
Or have it test a range of cells to know in which folder it's in.
If
Test Range ("J27") If = "Available" then Look in Available Folder.
ElseIF
Test Range ("J27") If = "Retire" then Look in Retire Folder.
ElseIF
Test Range ("J27") If = Anything other than "Retire","Available", "" then Look in WIP Folder.
ElseIF
Test Range ("J27") If = "" then Go To Next Range
ElseIF
Test Range ("J23") If = "Available" then Look in Available Folder.
ElseIF
Test Range ("J23") If = "Retire" then Look in Available Folder.
ElseIF
Test Range ("J23") If = Anything other than "Retire","Available", "" then Look in WIP Folder.
ElseIF
Test Range ("J23") If = "" then Go To Next Range.
ElseIF
Test Range ("J19") If = "Available" then Look in Available Folder.
ElseIF
Test Range ("J19") If = "Retire" then Look in Available Folder.
ElseIF
Test Range ("J19") If = Anything other than "Retire","Available", "" then Look in WIP Folder.
ElseIF
Test Range ("J19") If = "" then Go To Next Range.
ElseIF
Test Range ("J15") If = "Available" then Look in Available Folder.
ElseIF
Test Range ("J15") If = "Retire" then Look in Available Folder.
ElseIF
Test Range ("J15") If = Anything other than "Retire","Available", "" then Look in WIP Folder.
ElseIF
Test Range ("J15") If = "" then Go To Next Range.
ElseIF
Test Range ("J11") If = "Available" then Look in Available Folder.
ElseIF
Test Range ("J11") If = "Retire" then Look in Available Folder.
ElseIF
Test Range ("J11") If = Anything other than "Retire","Available", "" then Look in WIP Folder.
ElseIF
Test Range ("J11") If = "" then
End Sub
How can I do this.