See code below....
I have this code to open a file explorer and let you select one or more files and then paste the file path to the next available K cell. I want the code to post just the file name and not the full path. How would I do this??? Thanks in advance!!!! PS I would like it to paste the file extension too...So file name and file extension
Code:
Sub GetFilePath()Set myFile = Application.FileDialog(msoFileDialogOpen)
With myFile
.Title = "Choose File"
.AllowMultiSelect = True
If .Show <> -1 Then
Exit Sub
End If
For I = 1 To .SelectedItems.Count
Range("K" & Rows.Count).End(xlUp).Offset(1) = .SelectedItems(I)
Next I
End With
End Sub
I have this code to open a file explorer and let you select one or more files and then paste the file path to the next available K cell. I want the code to post just the file name and not the full path. How would I do this??? Thanks in advance!!!! PS I would like it to paste the file extension too...So file name and file extension