Search Contextures Sites
If you need to add links or embed videos on a web page, you can use formulas in Excel to create the HTML or IFRAME code. Download the templates, and enter your URL, and other details, then copy and paste the code.
The first sample file is designed to create product links, if you are an Amazon affiliate.
- In the template, enter the product code and product title
- NOTE: the Product code (ASIN) cell is formatted as text, to preserve any leading zeros
- Enter your Amazon affiliate tracking ID, so the link will contain that ID
- Then copy the link or the HTML code, and paste it into a web page or blog article.
In the "Copy This Link" cell, a formula combines the first part of the Amazon URL, with the product code (ASIN) and the Tracking ID.
=http://amzn.com/ & ProdCode & "?tag=" &TrackID
If you copy the code from cell B5, and paste into a blog post, you'll see a simple URL link, as shown below. The link works correctly, but doesn't show the product name.
In the "Copy This HTML" cell, a more sophisticated link is created. It shows the product name, and has a link to the product's URL.
The formula in that cell refers to the 4 HTML text cells, located below the Tracking ID cell.
The four HTML cells have snippets of text that are required for building the HTML code. The formula in cell B7 combines the product title and the link, with those four snippets of HTML code.
=HTML_01 & ProdTitle & HTML_02 & ProdLink
& HTML_03 & ProdTitle & HTML_04
All the cells are named, so it's easier to understand the formula. You can follow the colored references in the screen shot below.
If you copy the "Copy This HTML" cell, and paste into a web page, the link shows the product name. If you point to the link, the product title appears in a little popup. For example, here is the link created by the HTML code in the sample formula above
To embed a YouTube video, or other web content, on your website, you can use IFRAME code. In this template, there are 2 data entry sheets -- one for YouTube embed code, and one for other types of IFRAMES.
Fill in the details, such as the Video ID, and video name.
Combine the Code Strings
In a cell below the variable entry section, a formula creates the IFRAME code:
- It uses the & operator, to combine text strings
- The CHAR function uses 34 as its argument, to create double quote marks
- The IF formulas return a variable based on Yes or No selections
Use the IFRAME Code
To use the code, copy the IFRAME/HTML code, and paste it into a web page or blog article.
- The iframe code shows the video
- Below that, the HTML code shows a text link.
- Amazon Links HTML: Click here -- AmazonLinksMaker.zip -- to download the Amazon Links sample file. The zipped file is in xlsx format, and does not contain macros.
- IFRAME Code: Click here -- exceliframegenerator.zip -- to download the IFRAME code sample file. The zipped file is in xlsx format, and does not contain any macros.
Contextures Inc., Copyright ©2016
All rights reserved.
Last updated: June 8, 2016