Skip i'r prif gynnwys

Sut i drosi URLau delwedd yn ddelweddau go iawn yn Excel?

doc url i img 1

Os oes gennych restr o gyfeiriadau URL delwedd yng ngholofn A, ac yn awr, rydych chi am lawrlwytho'r lluniau cyfatebol o'r URLau a'u harddangos i'r golofn B gyfagos fel y llun chwith a ddangosir. Yn Excel, sut allech chi dynnu'r lluniau go iawn o'r URLau delwedd yn gyflym ac yn hawdd?

Trosi URLau'r ddelwedd yn ddelweddau gwirioneddol gyda chod VBA

Trosi'r URLs delwedd i ddelweddau gwirioneddol gyda Kutools ar gyfer Excel


Trosi URLau'r ddelwedd yn ddelweddau gwirioneddol gyda chod VBA

Gall y cod VBA canlynol eich helpu i echdynnu'r delweddau go iawn o gyfeiriadau URL y ddelwedd yn gyflym, gwnewch fel hyn:

1. Daliwch i lawr y ALT + F11 allweddi i agor ffenestr Microsoft Visual Basic for Applications.

2. Cliciwch Mewnosod > Modiwlau, a gludwch y cod canlynol yn y Ffenestr Modiwl.

Cod VBA: Trosi URLau'r ddelwedd yn ddelweddau go iawn:

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

Nodiadau: 

  • 1. Yn y cod uchod, A2: A5 yw'r ystod o gelloedd sy'n cynnwys y cyfeiriadau URL rydych chi am echdynnu'r delweddau, dylech chi newid cyfeiriadau celloedd i'ch angen.
  • 2. Gyda'r cod hwn, ni allwch nodi maint y delweddau a dynnwyd i'ch angen.
  • 3. Dim ond y delweddau actural y gall y cod uchod eu tynnu i'r celloedd ar wahân i'ch colofn URL, ni allwch nodi cell i allbwn y delweddau.
  • 4. Dylai fod gennych rywfaint o wybodaeth sylfaenol am y cod, os bydd unrhyw gymeriad yn cael ei fethu neu'n anghywir, ni fydd y cod yn cael ei weithredu'n llwyddiannus.

3. Yna pwyswch F5 allwedd i redeg y cod hwn, ac mae'r holl luniau cyfatebol wedi'u tynnu o'r URLau delwedd i'r golofn gyfagos ar unwaith, a bydd y delweddau'n cael eu gosod yng nghanol eich celloedd penodol, gweler y screenshot:

doc url i img 2


Trosi'r URLs delwedd i ddelweddau gwirioneddol gyda Kutools ar gyfer Excel

Os nad ydych chi'n gyfarwydd â'r cod VBA neu eisiau unioni cyfyngiad y cod uchod, Kutools ar gyfer Excel's Mewnosod Lluniau ar ffurf Llwybr (URL) gall nodwedd eich helpu i fewnosod y delweddau cyfatebol yn gyflym yn seiliedig ar y cyfeiriadau URL neu'r llwybr penodol yn eich cyfrifiadur fel islaw'r screenshot a ddangosir. Cliciwch i lawrlwytho Kutools ar gyfer Excel!

Nodyn:I gymhwyso hyn Mewnosod Lluniau ar ffurf Llwybr (URL), yn gyntaf, dylech lawrlwytho'r Kutools ar gyfer Excel, ac yna cymhwyswch y nodwedd yn gyflym ac yn hawdd.

Ar ôl gosod Kutools ar gyfer Excel, gwnewch fel hyn:

1. Cliciwch Kutools > Mewnosod > Mewnosod Lluniau ar ffurf Llwybr (URL), yn y blwch deialog popped out, gosodwch y gweithrediadau canlynol, gweler sgrinluniau:

doc url i img 3 doc url i img 4

2. Yna, cliciwch Ok botwm, a bydd y lluniau'n cael eu tynnu o'r URLau, gweler y screenshot:

doc url i img 1

Cliciwch i Lawrlwytho a threialu am ddim Kutools ar gyfer Excel Nawr!

Offer Cynhyrchiant Swyddfa Gorau

🤖 Kutools AI Aide: Chwyldro dadansoddi data yn seiliedig ar: Cyflawniad Deallus   |  Cynhyrchu Cod  |  Creu Fformiwlâu Personol  |  Dadansoddi Data a Chynhyrchu Siartiau  |  Invoke Swyddogaethau Kutools...
Nodweddion Poblogaidd: Darganfod, Amlygu neu Adnabod Dyblygiadau   |  Dileu Rhesi Gwag   |  Cyfuno Colofnau neu Gelloedd heb Colli Data   |   Rownd heb Fformiwla ...
Super-edrych: VLookup Meini Prawf Lluosog    VLookup Gwerth Lluosog  |   VLookup Ar Draws Taflenni Lluosog   |   Edrych Niwlog ....
Rhestr gwympo Uwch: Creu Rhestr Gollwng yn Gyflym   |  Rhestr Gollwng Dibynnol   |  Rhestr Gollwng Aml-ddewis ....
Rheolwr Colofn: Ychwanegu Nifer Penodol o Golofnau  |  Symud Colofnau  |  Toglo Statws Gwelededd Colofnau Cudd  |  Cymharwch Ystodau a Cholofnau ...
Nodweddion dan Sylw: Ffocws ar y Grid   |  Golwg Dylunio   |   Bar Fformiwla Mawr    Rheolwr Llyfr Gwaith a Thaflen   |  Llyfrgell Adnoddau (Testun Auto)   |  Dewiswr Dyddiad   |  Cyfuno Taflenni Gwaith   |  Amgryptio/Dadgryptio Celloedd    Anfon E-byst trwy Restr   |  Hidlo Super   |   Hidlo Arbennig (hidlo mewn print trwm/italig/strikethrough...) ...
15 Set Offer Gorau12 Testun offer (Ychwanegu Testun, Dileu Cymeriadau,...)   |   50 + Siart Mathau (Siart Gantt,...)   |   40+ Ymarferol Fformiwlâu (Cyfrifwch oedran yn seiliedig ar ben-blwydd,...)   |   19 mewnosod offer (Mewnosod Cod QR, Mewnosod Llun o'r Llwybr,...)   |   12 Trosi offer (Rhifau i Eiriau, Trosi arian cyfred,...)   |   7 Uno a Hollti offer (Rhesi Cyfuno Uwch, Celloedd Hollt,...)   |   ... a mwy

Supercharge Eich Sgiliau Excel gyda Kutools ar gyfer Excel, a Phrofiad Effeithlonrwydd Fel Erioed Erioed. Kutools ar gyfer Excel Yn Cynnig Dros 300 o Nodweddion Uwch i Hybu Cynhyrchiant ac Arbed Amser.  Cliciwch Yma i Gael Y Nodwedd Sydd Ei Angen Y Mwyaf...

Disgrifiad


Mae Office Tab yn dod â rhyngwyneb Tabbed i Office, ac yn Gwneud Eich Gwaith yn Haws o lawer

  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
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