Consulting

Results 1 to 3 of 3

Thread: Create Bookmarks from cell names when saving as pdf

  1. #1
    VBAX Newbie
    Joined
    Sep 2019
    Posts
    2
    Location

    Create Bookmarks from cell names when saving as pdf

    I want to use cell names or names of named ranges as bookmarks. When I save as pdf I need these bookmarks to carry over to the pdf document.
    Is there a macro that can do this? Excel 365 with Adobe add-in. Adobe creates bookmark from Worksheet names ok but need it (or Excel) to create bookmarks from e.g. cell names and if possible hierarchical / tree menu as it does easily when creating pdfs from e.g. Word documents. Single Excel sheet I convert is saved as 60 pages, need these bookmarked for presentation as pdf.

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Worksheet.Names = A Collection of all Named Ranges and Formulas on that worksheet
    Workbook.Names = A Collection of all Named Ranges and Formulas in that Workbook

    dim Nme as Name
    For Each Nme in myWorksheet.Names
       If not Intersect(Nme.RefersToRange, myRange) Is Nothing then
         'Yes, that is the right Name
         Bookmark = Nme.name
         Exit for
       End If
    Next
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Newbie
    Joined
    Sep 2019
    Posts
    2
    Location
    Thanks very much for the reply. Please bear with me, I like messing with Excel but can only dabble in VBA code.
    Maybe I'm meant to add something specific for my specific workbook?
    I get run time error '424' Object Required and debug opens up, stopped at second line of code.
    I have a workbook called 'Report Template' containing 1 sheet called 'Report"
    The worksheet is 3 pages long with 4 named cells that I want to appear as bookmarks in the bookmark tree menu of pdf file when sheet is saved as pdf.
    (Original workbook is about 60 page worksheet but I've cut it down to 3 pages)
    Thanks again!
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •