Ga naar hoofdinhoud

Hoe afbeeldings-URL's naar werkelijke afbeeldingen in Excel te converteren?

doc url naar img 1

Als je een lijst met afbeeldings-URL-adressen in kolom A hebt, en nu, wil je de bijbehorende afbeeldingen van de URL's downloaden en ze in de aangrenzende kolom B weergeven zoals het linker screenshot wordt getoond. Hoe kunt u in Excel de daadwerkelijke afbeeldingen snel en gemakkelijk uit de afbeeldings-URL's extraheren?

Converteer de afbeeldings-URL's naar echte afbeeldingen met VBA-code

Converteer de afbeeldings-URL's naar daadwerkelijke afbeeldingen met Kutools voor Excel


Converteer de afbeeldings-URL's naar echte afbeeldingen met VBA-code

De volgende VBA-code kan u helpen om snel de daadwerkelijke afbeeldingen uit de afbeeldings-URL-adressen te extraheren, doe dit als volgt:

1. Houd de ALT + F11 -toetsen om het venster Microsoft Visual Basic for Applications te openen.

2. Klikken Invoegen > Moduleen plak de volgende code in het modulevenster.

VBA-code: converteer de afbeeldings-URL's naar daadwerkelijke afbeeldingen:

Sub URLPictureInsert()
Dim Pshp As Shape
Dim xRg As Range
Dim xCol As Long
On Error Resume Next
Application.ScreenUpdating = False
Set Rng = ActiveSheet.Range("A2:A5")
For Each cell In Rng
filenam = cell
ActiveSheet.Pictures.Insert(filenam).Select
Set Pshp = Selection.ShapeRange.Item(1)
If Pshp Is Nothing Then GoTo lab
xCol = cell.Column + 1
Set xRg = Cells(cell.Row, xCol)
With Pshp
.LockAspectRatio = msoFalse
If .Width > xRg.Width Then .Width = xRg.Width * 2 / 3
If .Height > xRg.Height Then .Height = xRg.Height * 2 / 3
.Top = xRg.Top + (xRg.Height - .Height) / 2
.Left = xRg.Left + (xRg.Width - .Width) / 2
End With
lab:
Set Pshp = Nothing
Range("A2").Select
Next
Application.ScreenUpdating = True
End Sub

Opmerkingen: 

  • 1. In de bovenstaande code, A2: A5 is het celbereik dat de URL-adressen bevat waarvan u de afbeeldingen wilt extraheren, u moet de celverwijzingen naar uw behoefte wijzigen.
  • 2. Met deze code kunt u de grootte van de geëxtraheerde afbeeldingen niet naar wens specificeren.
  • 3. De bovenstaande code kan alleen de werkelijke afbeeldingen extraheren in de cellen naast uw URL-kolom, u kunt geen cel specificeren om de afbeeldingen uit te voeren.
  • 4. U moet enige basiskennis van de code hebben. Als een karakter ontbreekt of onjuist is, zal de code niet met succes worden uitgevoerd.

3. Druk vervolgens op F5 sleutel om deze code uit te voeren, en alle bijbehorende afbeeldingen zijn in één keer uit de afbeeldings-URL's naar de aangrenzende kolom geëxtraheerd en de afbeeldingen worden in het midden van uw specifieke cellen geplaatst, zie screenshot:

doc url naar img 2


Converteer de afbeeldings-URL's naar daadwerkelijke afbeeldingen met Kutools voor Excel

Als u niet bekend bent met de VBA-code of de beperking van de bovenstaande code wilt verhelpen, Kutools for Excel's Afbeeldingen invoegen pad (URL) functie kan u helpen om snel de corresponderende afbeeldingen in te voegen op basis van de URL-adressen of het specifieke pad op uw computer, zoals onderstaand screenshot. Klik om Kutools voor Excel te downloaden!

Note:Om dit toe te passen Afbeeldingen invoegen pad (URL), ten eerste moet u het Kutools for Excelen pas de functie vervolgens snel en gemakkelijk toe.

Na het installeren van Kutools for Excel, doe dit als volgt:

1. Klikken Kutools > Invoegen > Afbeeldingen invoegen pad (URL), stel in het uitgeklapte dialoogvenster de volgende bewerkingen in, zie screenshots:

doc url naar img 3 doc url naar img 4

2. Dan klikken Ok knop, en de afbeeldingen worden uit de URL's gehaald, zie screenshot:

doc url naar img 1

Klik om Kutools voor Excel nu te downloaden en gratis uit te proberen!

Beste Office-productiviteitstools

🤖 Kutools AI-assistent: Een revolutie teweegbrengen in de data-analyse op basis van: Intelligente uitvoering   |  Genereer code  |  Aangepaste formules maken  |  Analyseer gegevens en genereer grafieken  |  Roep Kutools-functies aan...
Populaire functies: Zoek, markeer of identificeer duplicaten   |  Verwijder lege rijen   |  Combineer kolommen of cellen zonder gegevens te verliezen   |   Ronde zonder formule ...
Super opzoeken: Meerdere criteria VLookup    VLookup met meerdere waarden  |   VOpzoeken over meerdere bladen   |   Fuzzy opzoeken ....
Geavanceerde vervolgkeuzelijst: Maak snel een vervolgkeuzelijst   |  Afhankelijke vervolgkeuzelijst   |  Multi-select vervolgkeuzelijst ....
Kolom Beheerder: Voeg een specifiek aantal kolommen toe  |  Kolommen verplaatsen  |  Schakel de zichtbaarheidsstatus van verborgen kolommen in  |  Vergelijk bereiken en kolommen ...
Uitgelichte functies: Raster focus   |  Ontwerpweergave   |   Grote formulebalk    Werkmap- en bladbeheer   |  resource Library (Auto-tekst)   |  Datumkiezer   |  Combineer werkbladen   |  Cellen coderen/decoderen    Stuur e-mails per lijst   |  Super filter   |   Speciaal filter (filter vet/cursief/doorhalen...) ...
Top 15 gereedschapsets12 Tekst Tools (toe te voegen tekst, Tekens verwijderen, ...)   |   50+ tabel Types (Gantt Chart, ...)   |   40+ Praktisch Formules (Bereken leeftijd op basis van verjaardag, ...)   |   19 Invoeging Tools (QR-code invoegen, Afbeelding invoegen vanaf pad, ...)   |   12 Camper ombouw Tools (Getallen naar woorden, Currency Conversion, ...)   |   7 Samenvoegen en splitsen Tools (Geavanceerd Combineer rijen, Gespleten cellen, ...)   |   ... en meer

Geef uw Excel-vaardigheden een boost met Kutools voor Excel en ervaar efficiëntie als nooit tevoren. Kutools voor Excel biedt meer dan 300 geavanceerde functies om de productiviteit te verhogen en tijd te besparen.  Klik hier om de functie te krijgen die u het meest nodig heeft...

Omschrijving


Office-tabblad Brengt een interface met tabbladen naar Office en maakt uw werk veel gemakkelijker

  • Schakel bewerken en lezen met tabbladen in Word, Excel, PowerPoint in, Publisher, Access, Visio en Project.
  • Open en maak meerdere documenten in nieuwe tabbladen van hetzelfde venster in plaats van in nieuwe vensters.
  • Verhoogt uw productiviteit met 50% en vermindert honderden muisklikken voor u elke dag!
Comments (61)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
can anyone help to extract mutiple links folllowed by comma  in one cell 
This comment was minimized by the moderator on the site
I own Kutools and I cannot seem to get this function to work properly. After I run it based on the examples above I get a message that says "1 picture(s) failed to be inserted"
Its not an htpps address. And the link the works fine when clicking from excel.
Please help
This comment was minimized by the moderator on the site
I have the same problem now. It worked very well yesterday, but today it's just not working :(
This comment was minimized by the moderator on the site
If I want the image to resize with the cell, is it as simple as changing this line to "msoTrue"?.LockAspectRatio = msoFalse


This comment was minimized by the moderator on the site
When I renew it takes the same picture again
So it adds images on top of each other
how can i prevent this?
Do not add the added picture again ?how can I do?
edit: also pictures are not loading when we open later?
This comment was minimized by the moderator on the site
When I renew it takes the same picture againSo it adds images on top of each other
how can i prevent this?
Do not add the added picture again ?how can I do?
This comment was minimized by the moderator on the site
thank you for VBA code, i able to get the url images as picture
but, after file closed, and then i opened it again, picture missing.
how to solve this problem?
This comment was minimized by the moderator on the site
Hello, Robby,After copying and pasting the code, when you close the workbook, you should save the file as Excel Macro-Enabled Workbook format for saving the code.When reopen the workbook, you should click the Enable Content button from the yellow ribbon at the top of the workbook.Please try, thank you!
This comment was minimized by the moderator on the site
thank you for fast response
I have save as Excel Enable Workbook and also Enable Content, and Picture will be shown up if i connected to internet, but when offline mode, the picture will be missing, Excel message : Picture can't be display
is there any solution so the picture will still shown up even though i am in offline mode (no internet available)
This comment was minimized by the moderator on the site
Hi, Robby, In this case, if you are in offline mode, I recommend you to use the Insert Pictures form Path(URL) feature of Kutools for Excel, you can download the Kutools and use it 30 days for free trail. After inserting the pictures, the pictures will be saved into the workbook.Please try.
This comment was minimized by the moderator on the site
What image types does this work with? I have mostly svg files and those are not working, but png and jpeg are fine.
This comment was minimized by the moderator on the site
Hello, travwoody,Yes, as you said, the code does not work for the svg files.Or can you insert a picture url here? We can test your image url for modifying the code.Thank you!
This comment was minimized by the moderator on the site
Why this line is not working for me?
Set Pshp = Selection.ShapeRange.Item(1)
Pshp object is becoming nothing, even though I have a valid image URL
This comment was minimized by the moderator on the site
I will also specify that I am writing about the VBA script
This comment was minimized by the moderator on the site
This code works great. Thank you!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations