I have a created a macro which Imports a Text File. The macro results in the following code:

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\....\2_200_10_55_50_shared.kna" _
, Destination:=Range("A2"))
.Name = "400_100_35_0_baseline7"

Two questions:

1. I have been editing this macro each time I run it in order to bring in different files with slightly different filenames. I would like to automate this so that the filename in the TEXT string updates automatically based on a text string located in a reference cell. Is this possible?

I tried dimensioning the string as a variable and inserting it into the TEXT string, but it doesn't seem to work or my code is bad.

2. What is the '.Name' line of code in the example above?

Thanks for any input.