+ Reply to Thread
Results 1 to 12 of 12

When data is copied to another workbook, hyperlinks as not copied or they don't work

  1. #1
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    When data is copied to another workbook, hyperlinks as not copied or they don't work

    Hi all,
    I have a Master work book, where
    -sheet1 information is saved in PDF format to intended folder
    -Email is generated with this PDF attached
    -Data is copied in sheet as per condition in sheet1
    -hyperlink is created to this PDF in the last row
    ( creation of hyperlink is through formula combination- I am kindly helped by Greg M to achieve this)
    All is explained in the work book attached.
    Please also refer to the thread where it all started to get more information.
    HTML Code: 
    I have provided a form button on slave workbook where data is copied from master workbook .
    For now the master book first needs to be opened- another issue I am struggling with.
    I want to achieve a solution where hyperlinks are copied to slave workbook perfectly & work as intended
    I need help please.
    Many thanks
    Kind regards
    Attached Files Attached Files

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: When data is copied to another workbook, hyperlinks as not copied or they don't work

    Hi again,

    I've had a look at the workbooks you posted and, on my system, the hyperlinks seem to operate correctly when they are copied to the Slave workbook.

    I don't think it is possible to copy a range from the Master workbook unless that workbook is open. Is it acceptable for your Copy routine to automatically open the Master workbook, copy and paste the required range, and then automatically close the Master workbook?

    If the above approach is not suitable, I think it will be necessary for you to LINK all of the cells in the table in the Slave workbook to the corresponding cells in the Master workbook - it's not an ideal situation, but I'm not sure if there are other options available.


    Regards,

    Greg M

  3. #3
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: When data is copied to another workbook, hyperlinks as not copied or they don't work

    Hi Greg M,
    Your approach is more logical and I want to adapt it.
    Thanks for that.
    If possible can you post me the amended workbooks ( hope if my copy code is right)
    ( basically routine to open copy and close which I can assign to the commandbutton. I just recorded it in a basic form.)
    Then I will try again on my system.
    Thanks Greg again.
    Kind regards
    KK1234

  4. #4
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: When data is copied to another workbook, hyperlinks as not copied or they don't work

    Hi Greg again,
    Just a thought.
    What if we amend code in Master to save data in Slave workbook also.
    Then there is no need to link both.
    Only question may be if the hyperlinks will work on Slave.
    What do you think?
    Thanks
    Kind regards
    KK1234

  5. #5
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: When data is copied to another workbook, hyperlinks as not copied or they don't work

    Hi again,

    Yes, I think the idea of copying automatically from the Master workbook to the Slave is good, especially if the original "problem" was that you didn't want to open the Master workbook unnecessarily.

    You can adapt your original "SaveAsPdfAndEmail" routine to include code which will open the Slave workbook. Obviously you need to move the "Macro1" routine from the Slave workbook into the Master workbook.

    The sequence then becomes:


    Run the "SaveAsPdfAndEmail" routine
    Run code to open the Slave workbook
    Run the "Macro1" routine (which you've already moved to the Master workbook)
    Run code to save the Slave workbook and then close it


    If you need me to help with the above, let me know where you're having problems and I'll see what I can do.

    Regards,

    Greg M

  6. #6
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: When data is copied to another workbook, hyperlinks as not copied or they don't work

    Thanks Greg.
    I will do the code and let me know.
    I think we are close to the solution.
    Kind regards
    KK1234

  7. #7
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: When data is copied to another workbook, hyperlinks as not copied or they don't work

    Hi Greg,
    Some issues and I cant resolve it.
    My new code is as follows:
    This is in sheet1 Master
    Please Login or Register  to view this content.
    I have attached the new work book.
    Need help again. Sorry
    Attached Files Attached Files

  8. #8
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: When data is copied to another workbook, hyperlinks as not copied or they don't work

    Hi again,

    Take a look at the attached workbooks and see if they do what you need.

    I've rewritten a lot of your code and broken it down into "bite-sized" routines. I think that this will make the structure of the code more easy to understand.

    Save both of the files in the same folder. If you need to move the "Slave" workbook to another location you should insert the approriate value in the highlighted statement:



    Please Login or Register  to view this content.


    If you need me to explain anything I've done, let me know and I'll see what I can do.

    Regards,

    Greg M
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: When data is copied to another workbook, hyperlinks as not copied or they don't work

    Hi Greg M,
    Really Fantastic work by you.
    Thank you for giving your time for this.
    I took a while to understand the code, I am bit slow in learning.
    But went over again and again , step by step to understand it.
    You have explained it in a way for me to understand it very easily.
    I actually want to click many many stars for you, but it allows me only once.
    I really don't know how to thank you.
    BIG THANK YOU TO YOU GREG M
    Kind regards
    KK1234

  10. #10
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: When data is copied to another workbook, hyperlinks as not copied or they don't work

    Hi again KK1234,

    You're very welcome

    Many thanks for all of your feedback, your kind words and the Reputation increase you gave me - I'm really pleased that I was able to help.

    Best regards,

    Greg M

  11. #11
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: When data is copied to another workbook, hyperlinks as not copied or they don't work

    Hi Greg M again,
    Most amazing part is the code is
    Please Login or Register  to view this content.
    Really very very very clever
    Hope all of us who see this work will be as amazed as I am.
    Thanks . You made my day
    Will keep in touch
    Kind regards
    KK1234

  12. #12
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: When data is copied to another workbook, hyperlinks as not copied or they don't work

    Thanks KK1234 - let me know if you need help with anything else.

    Regards,

    Greg M

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Data will be copied from a separate workbook to worksheet RawData in another workbook
    By pghpens44 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2014, 10:07 AM
  2. [SOLVED] Updating a copied workbook with data from the original
    By simonlblea in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2013, 08:33 AM
  3. Copying multiple worksheet so that copied hyperlinks link to new copied sheets
    By chrisjames25 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2013, 02:37 PM
  4. Hyperlinks copied from Excel per VBA won't work properly
    By axisambrosia in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2013, 09:37 AM
  5. Importing data from worksheet to be copied in another workbook
    By klowjet in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-13-2010, 10:49 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1