KCBigdogCWH
New Member
- Joined
- Apr 8, 2019
- Messages
- 2
I am new to MrExcel and would appreciate anyone 's suggestion regarding an issue I am having with Excel VBA
I have an Excel concatenated text, which I turn into a hyperlink. I am trying to loop through the list and determine which ones have a file associated and which do not: The code below returns at the- If Dir(): Compile Error: Wrong number of arguments or invalid property assignment
Public Sub Verify_Files()
Dim Name As String
Application.ScreenUpdating = False
Worksheets("Estimate Location").Select
Range("K6").Select
Do Until IsEmpty(ActiveCell)
ActiveCell.Select
Name = ActiveCell.Value
If Dir(Name) = "" Then
Selection.Offset(0, 2).Value = "NO FILE"
Else
Selection.Offset(0, 2).Value = "FILE FOUND"
End If
Selection.Offset(1, 0).Select
ActiveCell.Select
Loop
Application.ScreenUpdating = True
Range("K6").Select
End Sub
I have an Excel concatenated text, which I turn into a hyperlink. I am trying to loop through the list and determine which ones have a file associated and which do not: The code below returns at the- If Dir(): Compile Error: Wrong number of arguments or invalid property assignment
Public Sub Verify_Files()
Dim Name As String
Application.ScreenUpdating = False
Worksheets("Estimate Location").Select
Range("K6").Select
Do Until IsEmpty(ActiveCell)
ActiveCell.Select
Name = ActiveCell.Value
If Dir(Name) = "" Then
Selection.Offset(0, 2).Value = "NO FILE"
Else
Selection.Offset(0, 2).Value = "FILE FOUND"
End If
Selection.Offset(1, 0).Select
ActiveCell.Select
Loop
Application.ScreenUpdating = True
Range("K6").Select
End Sub