Skip to main content

Conas URLanna íomhá a thiontú go híomhánna iarbhír in Excel?

doc url a img 1

Má tá liosta de sheoltaí URL íomhá agat i gcolún A, agus anois, ba mhaith leat na pictiúir chomhfhreagracha a íoslódáil ó na URLanna agus iad a thaispeáint sa cholún B in aice láimhe mar a thaispeántar ar chlé. In Excel, conas a d’fhéadfá na pictiúir iarbhír a bhaint as URLanna na híomhá go tapa agus go héasca?

Tiontaigh URLanna na híomhá go híomhánna iarbhír le cód VBA

Tiontaigh URLanna na híomhá go híomhánna iarbhír le Kutools for Excel


Tiontaigh URLanna na híomhá go híomhánna iarbhír le cód VBA

Is féidir leis an gcód VBA seo a leanas cabhrú leat na híomhánna iarbhír a bhaint go tapa ó sheoltaí URL na híomhá, déan mar seo le do thoil:

1. Coinnigh síos an ALT + F11 eochracha chun an fhuinneog Microsoft Visual Basic for Applications a oscailt.

2. Cliceáil Ionsáigh > Modúil, agus greamaigh an cód seo a leanas i bhFuinneog an Mhodúil.

Cód VBA: Tiontaigh URLanna na híomhá go híomhánna iarbhír:

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

Nótaí: 

  • 1. Sa chód thuas, A2: A5 is é an raon cealla ina bhfuil na seoltaí URL is mian leat na híomhánna a bhaint astu, ba cheart duit na tagairtí cille do do riachtanas a athrú.
  • 2. Leis an gcód seo, ní féidir leat méid na n-íomhánna eastósctha a shonrú de réir do riachtanas.
  • 3. Ní féidir leis an gcód thuas ach na híomhánna achtúireacha a bhaint sna cealla seachas do cholún URL, ní féidir leat cill a shonrú chun na híomhánna a aschur.
  • 4. Ba cheart go mbeadh roinnt eolais bhunúsach agat ar an gcód, má tá carachtar ar bith caillte nó mícheart, ní dhéanfar an cód a fhorghníomhú go rathúil.

3. Ansin brúigh F5 eochair chun an cód seo a rith, agus baineadh na pictiúir chomhfhreagracha go léir ó URLanna na híomhá chuig an gcolún cóngarach ag an am céanna, agus cuirfear na híomhánna i lár do chealla ar leith, féach an scáileán:

doc url a img 2


Tiontaigh URLanna na híomhá go híomhánna iarbhír le Kutools for Excel

Mura bhfuil tú eolach ar an gcód VBA nó má theastaíonn uait teorannú an chóid thuas a leigheas, Kutools le haghaidh Excel's Ionsáigh an fhoirm Pictiúir Conair (URL) is féidir le gné cabhrú leat na híomhánna comhfhreagracha a chur isteach go tapa bunaithe ar na seoltaí URL nó an cosán sonrach i do ríomhaire mar atá thíos an pictiúr a thaispeántar. Cliceáil chun Kutools a íoslódáil le haghaidh Excel!

nótaí:Chun é seo a chur i bhfeidhm Ionsáigh an fhoirm Pictiúir Conair (URL), ar dtús, ba cheart duit an Kutools le haghaidh Excel, agus ansin an ghné a chur i bhfeidhm go tapa agus go héasca.

Tar éis a shuiteáil Kutools le haghaidh Excel, déan mar seo le do thoil:

1. Cliceáil Kutools > Ionsáigh > Ionsáigh an fhoirm Pictiúir Conair (URL), sa bhosca dialóige popped out, socraigh na hoibríochtaí seo a leanas le do thoil, féach screenshots:

doc url a img 3 doc url a img 4

2. Ansin, cliceáil Ok cnaipe, agus bainfear na pictiúir as na URLanna, féach an scáileán:

doc url a img 1

Cliceáil chun Íoslódáil agus triail saor in aisce Kutools le haghaidh Excel Now!

Uirlisí Táirgiúlachta Oifige is Fearr

🤖 Kutools AI Aide: anailís sonraí a réabhlóidiú bunaithe ar: Forghníomhú Chliste   |  Gin Cód  |  Cruthaigh Foirmlí Saincheaptha  |  Anailís a dhéanamh ar Sonraí agus Cairteacha a Ghin  |  Feidhmeanna Kutools a agairt...
Gnéithe Coitianta: Faigh, Aibhsigh nó Aithnigh Dúblaigh   |  Scrios Sraitheanna Bána   |  Comhcheangail Colúin nó Cealla gan Sonraí a Chailleadh   |   Babhta gan Foirmle ...
Cuardaigh Super: Ilchritéir VLookup    VLookup Illuachanna  |   VLookup Trasna Ilbhileoga   |   Amharc doiléir ....
Liosta anuas Casta: Go tapa Cruthaigh Liosta Anuas   |  Liosta anuas Cleithiúnach   |  Liosta Buail Isteach Ilroghnacha ....
Bainisteoir Colún: Cuir Líon Sonrach Colún leis  |  Colúin Bog  |  Scoránaigh Stádas Infheictheachta na gColún Ceilte  |  Déan comparáid idir Raonta & Colúin ...
Gnéithe Réadmhaoin: Fócas Eangaí   |  Amharc Dearaidh   |   Barra Mór na Foirmle    Leabhar Oibre & Bainisteoir Bileog   |  Leabharlann Acmhainní (Uaththéacs)   |  Piocálaí Dáta   |  Comhcheangail Bileoga Oibre   |  Criptigh/Díchriptigh Cealla    Seol Ríomhphost trí Liosta   |  Scagaire Super   |   Scagaire Speisialta (scagaire trom/iodálach/stailc tríd...) ...
Barr 15 Uirlisí12 Téacs uirlisí (Cuir Téacs, Bain Carachtair,...)   |   50 + Cairt cineálacha (Cairt Gantt,...)   |   40+ Praiticiúil Foirmlí (Ríomh aois bunaithe ar lá breithe,...)   |   19 Insertion uirlisí (Cuir isteach Cód QR, Ionsáigh Pictiúr ón gCosán,...)   |   12 Tiontú uirlisí (Uimhreacha le Focail, Comhshó Airgeadra,...)   |   7 Cumaisc & Scoilt uirlisí (Sraitheanna Comhcheangail Casta, Cealla Scoilt,...)   |   ... agus eile

Supercharge Do Scileanna Excel le Kutools le haghaidh Excel, agus Éifeachtúlacht Taithí Cosúil Ná Roimhe. Kutools le haghaidh Excel Tairiscintí Níos mó ná 300 Ardghnéithe chun Táirgiúlacht a Treisiú agus Sábháil Am.  Cliceáil anseo chun an ghné is mó a theastaíonn uait a fháil ...

Tuairisc


Tugann Tab Oifige comhéadan Tabbed chuig Office, agus Déan Do Obair i bhfad Níos Éasca

  • Cumasaigh eagarthóireacht agus léamh tabbed i Word, Excel, PowerPoint, Foilsitheoir, Rochtain, Visio agus Tionscadal.
  • Oscail agus cruthaigh cáipéisí iolracha i gcluaisíní nua den fhuinneog chéanna, seachas i bhfuinneoga nua.
  • Méadaíonn do tháirgiúlacht 50%, agus laghdaíonn sé na céadta cad a tharlaíonn nuair luch duit gach lá!
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