Share via

Excel Object formula

Anonymous
2016-10-07T13:28:14+00:00

Hi,

I know it's possible to insert a pdf into an Excel file (as an object), but is it possible to have a vlookup or if formula (or any other) that could give me the good object based on what I enter in cell A1?

Thanks.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2016-10-11T13:01:41+00:00

    PayerRainville,

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    Dim ss as String

    If Target.Address = "$B$1" Then

    Application.ScreenUpdating = False

    ss = Range("A5").Value   ' A5 holds the text string "Object1"

    Sheets("Attachments").OLEObjects(ss).Verb

    Me.Activate

    Application.ScreenUpdating = True

    End If

    End Sub

    --

    Regards,

    Tom Ogilvy

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-10-11T12:48:22+00:00

    Hi Tom,

    I know it's possible to hyperlink to an object (the pdf) with VBA, but is it possible to hyperlink based on the info in a cell? For example, in cell A1, Object 2 is entered, than when I click on B1, pdf Object 2 is shown, if change to Object 3, Object 3 is shown, etc.?

    For now, I can open the pdf when I click on cell B1, but it's based on the name of the object and not cell. Do you have an idea?

    Thanks as always.

    Private Sub Worksheet_SelectionChange(``ByVal Target ``As Range)

    ` If Target.Address = "$B$1" Then Application.ScreenUpdating = False Sheets("Attachments").OLEObjects("Object 1").Verb 

    Me.Activate 

    Application.ScreenUpdating = True End If End Sub `

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-10-07T13:51:14+00:00

    can a formula give any information on an embedded object.   No.

    could you have a list of information about the object that you enter in a table or list format and then use vlookup to query those cells based on data you entered in a cell that identifies a unique row in the leftmost column of the lookup range - yes, you can do that.

    --

    Regards,

    Tom Ogilvy

    Was this answer helpful?

    0 comments No comments