Skip to content

sjain882/Excel-VBA-Macros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Macros created by me, unless otherwise specified.

Macros

Embed Image Links

Info:

  • Automatically embeds images in the place of image links

  • Can be re-run over cells to "fill in gaps" non-destructively

  • Works with URLs not ending in image extension, e.g, discord image link with token query param

  • If you add rows/columns around imported images, the embedded images move automatically

  • Saves the image with the document, instead of links which can go down

  • WARNING: No undo available! Duplicate your file before proceeding

  • Original source: by kresty @ https://superuser.com/a/1404121

  • Reworked by me:

    • Images are no longer stretched to fill cell - now preserves aspect ratio

    • Images are now properly resized to fit perfectly inside cell

    • Images are centered in the cell if smaller than the cell

    • Macro executes on currently selected cells, rather than having to manually specify range every time

    • Code cleaned up and commented

  • Example before: LFRD 2025 Bus Previews - B4 - With Hyperlink.xlsm

  • Example after: LFRD 2025 Bus Previews.xlsm

🖼 Preview

Before

After

Google Active Cell

  • Search the contents of currently selected cell with Google / Google Images / Flickr

  • Created by Booksticle, unmodified in this repository (except adding PtrSafe to ShellExecute declaration for 64-bit operation)

  • RunProgram from here (archive)

  • Google from here (archive)

  • Demo here (archive)

  • Example included in LFRD 2025 Bus Previews.xlsm

🛠 Setup Guide
  1. Developer > Visual Basic

  2. Modules > Module1 (in tree on left side)

  3. Paste (Declarations).vba in Declarations section:

Declarations

  1. Tools > Macros

  2. Under Macro Name type either FlickrIt / GoogleIt / GoogleImagesIt then click Create to create new macro section for the relevant function

  3. New section with Sub skeleton will be created. Replace entire contents of this section with the contents of the relevant .vba containing the function's code

  4. Save and close VBA Editor

  5. Developer > Macros > Select macro you want to assign keyboard shortcut to > Options

  6. Type a single key into shortcut box, e.g, G for CTRL+G. For CTRL+SHIFT+G, delete contents of box and type Shift+G (NOT Ctrl+Shift+G). Nothing else will work.

  7. Click OK

💼 Archived macros None

Other

How to print spreadsheet as single-page zoomable PDF?

  1. File > Print > Page Setup

  2. Scaling > Fit To > 1 pages wide by 1 tall

  3. OK

  4. Select Portrait/Landscape as appropriate

  5. Print

How to print spreadsheet with working Hyperlinks?

Normal File > Print will not work - you need to use Export.

  1. First, Print to PDF with above instructions to save print layout

  2. Then, File > Export > Create PDF/XPS document


External

(Macros & resources)

Booksticle - Assorted macros, shortcuts, Excel guides

About

My favourite Excel macros - some by me, some by others

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages