I'm having problems using variables with filenames.
I have a selection of .html files stored on my hard drive, I want to be able to write a macro that allows me to browse to and select these files (either individually or as a multiple selection), and then have the macro store the filepath(s) for use later.
I then want to create a new worksheet tab in Excel 2003 which uses part of the file name to name the worksheet tab; one new worksheet for each .html file selected. The file name looks like 'CUSTOMERNAME 1234ABCDEFG.html' and I want to use either just '1234ABCDEFG' or '1234ABCDEFG.html' as the worksheet tab name.
Once I have created and named the worksheet tab, I then want to use the full filepath with an insert new web query command to select all of the content of the .html file and import it into the worksheet tab I've just created and named (in cell A1)
I can prompt the user to select an .html file, but I cannot get the macro to store the filepath as a variable for later use. I can also add the new worksheet, but cannot get the macro to name the worksheet using a variable.
Any help or suggestions greatly appreciated!
Thanks in advance,
Lola
I have a selection of .html files stored on my hard drive, I want to be able to write a macro that allows me to browse to and select these files (either individually or as a multiple selection), and then have the macro store the filepath(s) for use later.
I then want to create a new worksheet tab in Excel 2003 which uses part of the file name to name the worksheet tab; one new worksheet for each .html file selected. The file name looks like 'CUSTOMERNAME 1234ABCDEFG.html' and I want to use either just '1234ABCDEFG' or '1234ABCDEFG.html' as the worksheet tab name.
Once I have created and named the worksheet tab, I then want to use the full filepath with an insert new web query command to select all of the content of the .html file and import it into the worksheet tab I've just created and named (in cell A1)
I can prompt the user to select an .html file, but I cannot get the macro to store the filepath as a variable for later use. I can also add the new worksheet, but cannot get the macro to name the worksheet using a variable.
Any help or suggestions greatly appreciated!
Thanks in advance,
Lola