Greetings,
In my userform, the user has to specify the location of three files.
I want each of these files, in turn, to be copied to a location on my workbook (So, destination = Worksheets("SLRisk Data").Range("A1") ).
It will then run some code to copy relevant sections to another worksheet (that bit is fine).
Afterwards, I want it to delete the data it just copied on to the SLRisk Data worksheet, and do it for the next file (so it'll do this three times).
Anyhow, I've looked online and I can't get any of the 'import fixed with' things working. It'll import the table but the format goes completely skewed to the point of uselessness.
I tried recording a macro to import the data - now, this kind of works. The issue is that I want the macro to use my TextBox1.Value as the data for the filepath, but it only accepts a string - it won't allow variables defined as strings or, well, anything deviating from "C:\Users\Folder\Folder\Folder\File.txt"
Here's the code which recording a macro gets me:
So, obviously, I want to change the bold bit - this is where I'm struggling. Any suggestions?Please Login or Register to view this content.
Thanks.
EDIT: Just as an example, I tried doing the following:
It didn't work - I tried removing quotation marks and whatnot... I even tried making the filname string include everything between .Add( and the last brackeft before .Name and couldn't get it working. *cry*Please Login or Register to view this content.
Bookmarks