+ Reply to Thread
Results 1 to 2 of 2

Macro to replace part of hyperlink

  1. #1
    Registered User
    Join Date
    10-16-2007
    Posts
    2

    Macro to replace part of hyperlink

    I need some help with the following issue.

    I'm having the following situation:

    Cell A1 contains three digits: 111
    Cell A4, A5, A6, A7 all contain the following example link: www.test.com/555.html/9990-451

    My probelm is that I want to create a macro which changes a part (the 555) of this link into the three 111 of cell A1.

    I have to use this macro for about 50 cells and the same for 50 sheets. This is why I really need a macro because doing it manually is quite a job.

    My main goal is to have a button which easily copy's the value of one cell into a part of a lot of other cells, without changing anything else in the links.

    Many thanks if someone can offer me a solution!

  2. #2
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    This is a stab in the dark because I'm not certain of your setup, but based on how you laid out your example, if you select the cell that has the "111" in it ("A1" in your example) this code will replace the characters in the links between the "/" and the ".html" in cells 3, 4, and 5 rows below the selected cell ("A4:A6" in your example).

    Please Login or Register  to view this content.
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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