Sep 09 2024 10:59 AM
Windows 11 v 23H2
Excel v 18.2407.1241.0
Can Autofill make series in both the text AND hyperlinks? Three columns of 32,767 lines: Column F has numeral-free copy with non-sequential hyperlinks to external files. Columns G and H have text ending in sequential numerals and also-sequential hyperlinks to other cells in the same worksheet. Trying to avoid manually filling and linking 98,211 cells but don't know how to Autofill both text and links.
Thank you!
Sep 09 2024 01:31 PM - edited Sep 09 2024 01:32 PM
@KurtHPickering I don't know if I'm understanding your situation correctly, but you may be able to do what you need by using the HYPERLINK function for F and G. For example, in H, you can use a formula like =HYPERLINK("#" & G1,F1). Then you can fill down F, G, and H. The # in the formula is a little trick to make the HYPERLINK go to a place in the document, rather than expecting a link to a web URL, for example. In this example, if you click a link in H, it will take you to the corresponding cell in F.
Sep 10 2024 07:46 AM
Thanx. I think I got about half of it across. What I'm looking for is a way to Autofill both text and links into the same cells, not necessarily at the same time but in a way that the second Autofill doesn't wipe out the first. The cells' texts also have a sequence to them, and doing whichever function I do first gets wiped out when I do the second. Best workaround I can figure is in progress: I've Autofilled the texts and am now doing the links individually - but with nearly 100,000 cells it'll take weeks if not months.
Sep 10 2024 07:52 AM
@KurtHPickering - it would be great if you could share a snippet of the workbook or some screen shots to make it clear how your data is set up and what you need to do.
Sep 11 2024 02:11 PM
Solution@KurtHPickering Hyperlinks won't fill in a series the way you hoped, but you have 2 options. You can either add columns and create the link with a HYPERLINK formula as below, or you could write a VBA macro that would go through all the cells and create the link.
The formula in column I is =HYPERLINK("#"&CELL("address",XLOOKUP(1*(TEXTAFTER(G2,"#")),$E$2:$E$11,$E$2:$E$11)),G2).
Breaking it down:
To use a macro, it would still be easier with a helper column to get the address of the cell to link to, then the macro could cycle through all the cells in G and H and create the hyperlinks. Once done, you could get rid of the helper column.
Sep 11 2024 02:11 PM
Solution@KurtHPickering Hyperlinks won't fill in a series the way you hoped, but you have 2 options. You can either add columns and create the link with a HYPERLINK formula as below, or you could write a VBA macro that would go through all the cells and create the link.
The formula in column I is =HYPERLINK("#"&CELL("address",XLOOKUP(1*(TEXTAFTER(G2,"#")),$E$2:$E$11,$E$2:$E$11)),G2).
Breaking it down:
To use a macro, it would still be easier with a helper column to get the address of the cell to link to, then the macro could cycle through all the cells in G and H and create the hyperlinks. Once done, you could get rid of the helper column.