Need to insert url on PNG files inside the spreadsheet

Copper Contributor

Screenshot 2023-05-27 224700.png

Hello, as you can see above, the spreadsheet already has a column with PNG files inside it. I need to put a url on these files so they can be used in the cloud.

How can I do this?

Remembering that I don't have these files external to this worksheet. They are already inside it as shown above in the photo.

 

Thanks for any help.

5 Replies

@Marcelo675 

The question isn't clear to me. Are you looking for a one-by-one solution or are you looking for a macro to do them for you? In case of a one-by-one solution: right-click on the item -> link -> add hyperlink (at the bottom). Or if you don't mind shortcuts: select the item and hit ctrl + k.

 

VBA

form-bulk-hyperlinker.png

In case you're looking for a solution through VBA, you could design a form like the one above. The code for the example form could be:

Private Sub CancelButton_Click()
    Unload Me
End Sub

Private Sub ConfirmButton_Click()
    ' Get the row select
    SelectedRange = Selection.Address
    
    ' Go over all rows
    For Each Cell In Range(SelectedRange)
        Hyperlink = UrlField.Value
        
        ' Check if the checkbox was checked to append the filename
        If AppendBox.Value = True Then
            ' Add the current cell value to the hyerlink
            Hyperlink = Hyperlink + Cell.Value
        End If
            
        ' Set the HyperLink
        ActiveSheet.Hyperlinks.Add Range(Cell.Address), Address:=Hyperlink
    Next Cell
End Sub

Hopefully, this answers your question.

Thanks @jimmaphy.
Unfortunately it didn't solve my problem. In the first case, insert the hyperlink, as I said I don't have these PNG files outside the excel sheet. So I have no way to point to any file outside of excel.

In the second case, that of VBA code, it does not appear in the options for macros to be executed. I followed a tutorial on how to insert your code into a macro and it didn't work. I'm completely new to this.


I'll try to explain better what I need.

These PNG files inside the spreadsheet need to become hyperlinked files as they will be used in a PowerApps application, they will be the images of the products in the gallery.

I have already imported the spreadsheet as a table into PowerApps, but as the PNG files do not have a hyperlink, these files are not recognized as an image within PowerApps.

Did I explain it better now?

Thanks for your help.
as I said I don't have these PNG files outside
Do you want to Upload image to image hosts like
https://www.imagehub.cc/
Thanks so much for all your help!

Another colleague gave me the answer.
There is another folder with the images , I need to upload those images to sharepoint or Onedrive
and use that URL link to be pasted in the dataset to show the pictures in the cloud.
The problem was solved.

Thanks again for all your help guys!