메인 컨텐츠로 가기

이미지 URL을 Excel에서 실제 이미지로 변환하는 방법은 무엇입니까?

img에 대한 문서 URL 1

A 열에 이미지 URL 주소 목록이 있고 이제 URL에서 해당 사진을 다운로드하여 왼쪽 스크린 샷과 같이 인접한 B 열에 표시하려고합니다. Excel에서 이미지 URL에서 실제 그림을 어떻게 빠르고 쉽게 추출 할 수 있습니까?

VBA 코드를 사용하여 이미지 URL을 실제 이미지로 변환

Excel 용 Kutools를 사용하여 이미지 URL을 실제 이미지로 변환


VBA 코드를 사용하여 이미지 URL을 실제 이미지로 변환

다음 VBA 코드는 이미지 URL 주소에서 실제 이미지를 빠르게 추출하는 데 도움이 될 수 있습니다. 다음과 같이하십시오.

1. 누르고 ALT + F11 키를 눌러 Microsoft Visual Basic for Applications 창을 엽니 다.

2. 딸깍 하는 소리 끼워 넣다 > 모듈을 클릭하고 모듈 창에 다음 코드를 붙여 넣습니다.

VBA 코드 : 이미지 URL을 실제 이미지로 변환 :

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

배송 시 요청 사항: 

  • 1. 위 코드에서 A2 : A5 이미지를 추출하려는 URL 주소를 포함하는 셀 범위입니다. 필요에 따라 셀 참조를 변경해야합니다.
  • 2.이 코드로는 추출 된 이미지의 크기를 필요에 따라 지정할 수 없습니다.
  • 3. 위의 코드는 실제 이미지를 URL 열 외에 셀로만 추출 할 수 있으며 이미지를 출력 할 셀을 지정할 수 없습니다.
  • 4. 코드에 대한 기본 지식이 있어야합니다. 문자가 누락되거나 잘못되면 코드가 성공적으로 실행되지 않습니다.

3. 그런 다음 F5 이 코드를 실행하려면 해당하는 모든 사진이 이미지 URL에서 인접한 열로 한 번에 추출되었으며 이미지는 특정 셀의 중앙에 배치됩니다. 스크린 샷을 참조하십시오.

img에 대한 문서 URL 2


Excel 용 Kutools를 사용하여 이미지 URL을 실제 이미지로 변환

VBA 코드에 익숙하지 않거나 위 코드의 제한 사항을 수정하려면 Excel 용 Kutools's 그림 삽입 경로 (URL) 기능을 사용하면 아래 스크린 샷과 같이 컴퓨터의 URL 주소 또는 특정 경로를 기반으로 cprresponding 이미지를 빠르게 삽입 할 수 있습니다. Excel 용 Kutools를 다운로드하려면 클릭하십시오!

주의 사항:이것을 적용하려면 그림 삽입 경로 (URL), 먼저 Excel 용 Kutools을 클릭 한 다음 기능을 빠르고 쉽게 적용하십시오.

설치 후 Excel 용 Kutools, 다음과 같이하십시오.

1. 딸깍 하는 소리 쿠툴 > 끼워 넣다 > 그림 삽입 경로 (URL), 팝업 대화 상자에서 다음 작업을 설정하십시오. 스크린 샷을 참조하십시오.

img에 대한 문서 URL 3 img에 대한 문서 URL 4

2. 그런 다음 Ok 버튼을 클릭하면 사진이 URL에서 추출됩니다. 스크린 샷 참조 :

img에 대한 문서 URL 1

Excel 용 Kutools를 지금 다운로드하고 무료로 평가하려면 클릭하십시오!

최고의 사무 생산성 도구

🤖 Kutools AI 보좌관: 다음을 기반으로 데이터 분석을 혁신합니다. 지능형 실행   |  코드 생성  |  사용자 정의 수식 만들기  |  데이터 분석 및 차트 생성  |  Kutools 기능 호출...
인기 기능: 중복 항목 찾기, 강조 표시 또는 식별   |  빈 행 삭제   |  데이터 손실 없이 열이나 셀 결합   |   수식없이 반올림 ...
슈퍼 조회: 다중 기준 VLookup    다중 값 VLookup  |   여러 시트에 걸친 VLookup   |   퍼지 조회 ....
고급 드롭다운 목록: 드롭다운 목록을 빠르게 생성   |  종속 드롭다운 목록   |  다중 선택 드롭 다운 목록 ....
열 관리자: 특정 개수의 열 추가  |  열 이동  |  Toggle 숨겨진 열의 가시성 상태  |  범위 및 열 비교 ...
특색 지어진 특징: 그리드 포커스   |  디자인보기   |   큰 수식 바    통합 문서 및 시트 관리자   |  리소스 라이브러리 (자동 텍스트)   |  날짜 선택기   |  워크 시트 결합   |  셀 암호화/해독    목록으로 이메일 보내기   |  슈퍼 필터   |   특수 필터 (굵게/기울임꼴/취소선 필터링...) ...
상위 15개 도구 세트12 본문 도구 (텍스트 추가, 문자 제거,...)   |   50+ 거래차트 유형 (Gantt 차트,...)   |   40+ 실용 방식 (생일을 기준으로 나이 계산,...)   |   19 삽입 도구 (QR 코드 삽입, 경로에서 그림 삽입,...)   |   12 매출 상승 도구 (숫자를 단어로, 환율,...)   |   7 병합 및 분할 도구 (고급 결합 행, 셀 분할,...)   |   ... 그리고 더

Excel용 Kutools로 Excel 기술을 강화하고 이전과는 전혀 다른 효율성을 경험해 보세요. Excel용 Kutools는 생산성을 높이고 시간을 절약하기 위해 300개 이상의 고급 기능을 제공합니다.  가장 필요한 기능을 얻으려면 여기를 클릭하십시오...

상품 설명


Office Tab은 Office에 탭 인터페이스를 제공하여 작업을 훨씬 쉽게 만듭니다.

  • Word, Excel, PowerPoint에서 탭 편집 및 읽기 사용, Publisher, Access, Visio 및 Project.
  • 새 창이 아닌 동일한 창의 새 탭에서 여러 문서를 열고 만듭니다.
  • 생산성을 50% 높이고 매일 수백 번의 마우스 클릭을 줄입니다!
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