Results 1 to 6 of 6

Referencing cells in VBA

Threaded View

  1. #1
    Registered User
    Join Date
    03-23-2024
    Location
    UK
    MS-Off Ver
    Microsoft 365 MSO Version 2402
    Posts
    3

    Referencing cells in VBA

    Hi all

    I'm having a brain fog moment -

    I have a workbook that contains many links to a customer portal

    I want to be able to update the portal ID across all links within the workbook based on the value added to a specific cell

    The master copy of the workbook has my portal ID (being the referenced ""143655455"") - my aim is to be able to just make a copy of the workbook for a new customer and replace my ID within all links with their ID easily

    At the moment I have this but I know its not correct - can someone help - its the "Range(F5)" section - I need to reference the value that is in Cell F5
    Public Sub Change_Hyperlinks()
        Dim ws As Worksheet
        Dim hlink As Hyperlink
        
        For Each ws In ActiveWorkbook.Worksheets
            For Each hlink In ws.Hyperlinks
            hlink.Address = Replace(hlink.Address, "143655455", Range(f5), Compare:=vbTextCompare)
            Next
        Next
            
    End Sub
    Also, happy to hear if someone has a better work around for this process


    Thanks
    Vicki
    Last edited by 6StringJazzer; 03-23-2024 at 08:06 PM. Reason: please use code tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA Cells, how to put dynamic formula referencing to specific cells (Row,Column)
    By analystbank in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-08-2023, 09:46 AM
  2. Google Sheets - How to create graph from cells referencing other cells sorted/filtered dif
    By ergalthema in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 03-05-2018, 02:35 PM
  3. Replies: 0
    Last Post: 03-05-2018, 02:35 PM
  4. Replies: 6
    Last Post: 04-18-2016, 05:31 PM
  5. Cells referencing one another
    By mbrandt5 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-12-2015, 05:17 AM
  6. Table Cells Referencing Specific Cells
    By shhhhh22 in forum Excel General
    Replies: 3
    Last Post: 12-06-2011, 03:51 PM
  7. [SOLVED] Referencing Cells
    By Bill W in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM

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