+ Reply to Thread
Results 1 to 3 of 3

VBA Help- Auto-update based on cell selection

  1. #1
    Registered User
    Join Date
    08-30-2022
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    5

    VBA Help- Auto-update based on cell selection

    Hi,

    I have recieved some help on my two options for the below problem, I will outline my two options and then what I wish/need

    Option 1:
    Pull data from Hyperlinks
    Using the code

    "Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
    Sheet1.Select
    Range("B27") = Evaluate("=" & Target.SubAddress)
    End Sub"

    I am able to pull the data I need from Sheet2!"cell reference" however as the book follows the hyperlink there is a jarring "stutter" for end users (not myself) that may be confusing.
    I wish for this to run without the switching from "schedule" sheet to "Sheet2" whilst still achieving the desired results

    Option 2:
    Follow comments and pull data.
    using the code

    "
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Cells.Count > 1 Then Exit Sub
    On Error GoTo errHand
    If Target.Comment.Text <> "" Then
    Range("B27") = Evaluate("=" & Target.Comment.Text)
    End If
    On Error GoTo 0
    errHand:
    End Sub"

    Problem with this is the need to enter individual comments with the appropriate reference from Sheet2!. If there is a way to have the "FIA1f" from "General English" row with a comment for "Sheet2!B2" and then for "FIA2" from "General english" to fill with "Sheet2!C2" and so on. Any options for not having to enter individual comments?

    I have attached workbooks for both the Hyperlinks and comments solution.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,191

    Re: VBA Help- Auto-update based on cell selection

    my understanding of requirement:

    in tab "Schedule"

    Please Login or Register  to view this content.
    in General module

    Please Login or Register  to view this content.
    I note you have 2 values for some entries so I used AF% as a test: rerturns concatenated values in B27

    Double click on cell to "activate"
    Attached Files Attached Files
    Last edited by JohnTopley; 09-03-2022 at 05:42 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    08-30-2022
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    5

    Re: VBA Help- Auto-update based on cell selection

    Thank you! this makes life much easier.

+ 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. Update Data selection for chart based off a referenced cell
    By mcini in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 10-29-2014, 05:02 PM
  2. Replies: 0
    Last Post: 03-20-2014, 10:57 AM
  3. [SOLVED] Auto Populate cell based on auto filter selection from table in same sheet
    By missydanni in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-02-2013, 05:03 PM
  4. Update a cell based on selection in dropdown list.
    By ladykickbox in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-26-2012, 07:45 AM
  5. Auto expand range based on first cell selection
    By Jimmy Moggles in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-29-2011, 07:56 AM
  6. Update formula based on cell selection
    By Maver1ck666 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-01-2010, 09:49 AM
  7. Auto-update initial drop-down selection based on previous drop-downs
    By thornomad in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-16-2010, 09:55 AM

Tags for this Thread

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