Please enable JavaScript to view this site.

A-Shell Reference

Added May 2023

//XL, AddLink, row=<#>, col=<#>, text=<display text> {,linkto=<link target>} {,Common //XL Parameters}

Addlink creates a link in the specified cell, with the specified display text, that jumps to the specified link target. Links are particularly useful for drawing the user's attention to explanatory footnotes (see AddFootnote) which might otherwise go unnoticed at the bottom of the sheet. But they can also be useful for creating a free-form table of contents to sections in a very large spreadsheet, or to jump from one sheet to an associated part of another.

The row and col parameters should be numeric, starting at 1 for the first row / column. Note that the link occupies only a single cell. If the link is to share row 1 with a banner (see SetBanner), then the banner size will be adjusted accordingly. For example, if the link is to occupy the cell A,1 then the banner will start in column B. Or, if there are ten columns in the spreadsheet and the link is positioned in row 1, column 10, then the banner will occupy row 1 columns 1 thru 9.

The text parameter determines what will display in the cell; blue and underlined like typical links, unless overridden via the Common //XL Parameters. It should probably be kept short since they occupy only a single cell and Excel does not always know how to properly wrap them.

The linkto parameter can be in one of the following forms:

A standard Excel cell address on the current sheet, e.g.

linkto=A99

linkto=$Q$2

 

A special alias link to the start of the footnotes; see AddFootnote. This is useful when you don't know what row the Footnotes will appear on when you are outputting the AddLink directive.

linkto=@footnotes

To link to a cell on another worksheet, prefix the cell address with the worksheet name and an exclamation point, e.g.

linkto=Detail!A1

To link to a URL, just specify the URL, including the scheme prefix:

linkto=https://www.microsabio.com

AddLink directives can appear anywhere in the source document; before or after the row in question has been populated. The one exception is that if the link location is sharing row 1 with SetBanner, the AddLink directive must come between the SetBanner and the headers.

See SetBanner for an example.

History

2023 May, A-Shell 6.5.1731, CSV2XL.SBX edit 279:  Function added to A-Shell.