Macro that exports to text or html files

matjnewton

New Member
Joined
Jun 10, 2011
Messages
1
Hi guys

I'm just wondering if this is possible.

I'm currently creating a limousine directory website, with one worksheet per city.

Each worksheet has the basics like "URL" "Name" "Description" "Ph#" and things like this.

Is it possible to have it output each worksheet a bit like a mailmerge, where it just slots in the basic details of each company into a pre-formatted html file and then saves each one as a .html file?

For example, the code would output a bit like this

Code:
< a href="http://www.examplelimo.com">Example Limo</a> - Based in Exampleland, we offer 50 limousines all at $5/hr including monkey chauffeurs. Ph#: 1-800-749-8646. http://www.examplelimo.com">Click here to visit</a>
<br><br>

< a href="http://www.examplelimo2.com">Example Limo 2</a> - Based in Exampleland, we offer 52 limousines all at $5/hr including monkey chauffeurs. Ph#: 1-800-749-8646. http://www.examplelimo2.com">Click here to visit</a>
<br><br>

Each worksheet would need to output to a different file, with the file name based on the name of the worksheet.

If anyone knows of ANY method to do this, Excel or otherwise, that would be awesome.
 
Last edited:

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I would have one tab with all the info that change be changed to customize each HTML file. Then have the other tab as the full html content, with links in the middle of the lines linking to each column of data. If you do this for the first HTML, then copy it multiple times. you can then just change the links over one column from the main file, or incorporate a cell in the top of your sheet that has "B" or "C", etc so when you change that cell, it'll link to B5, C5, etc in your main sheet.
 
Upvote 0

Forum statistics

Threads
1,224,591
Messages
6,179,768
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top