메인 컨텐츠로 가기

Excel에서 이미지를 클릭하면 확대하는 방법은 무엇입니까?

그림 목록을 열에 삽입하고 아래 스크린 샷과 같이 셀 크기와 그림 크기를 일치 시켰다고 가정합니다. 삽입 된 사진이 작아 보이기 때문에 어떤 목적 으로든 확대해야 할 수도 있습니다. 이 기사에서는 Excel에서 사진을 클릭하면 확대하고 두 번째 클릭으로 원래 크기로 복구하는 방법을 보여줍니다.

VBA 코드로 클릭하면 이미지 확대


VBA 코드로 클릭하면 이미지 확대

다음 VBA 코드는 Excel에서 이미지를 클릭 할 때 이미지를 확대하는 데 도움이 될 수 있습니다. 다음과 같이하십시오.

1. 확대 할 사진을 클릭하여 마우스 오른쪽 버튼으로 클릭 한 다음 매크로 지정 상황에 맞는 메뉴에서. 스크린 샷보기 :

2. 에서 매크로 지정 대화 상자에서 신규클래스 버튼을 클릭합니다.

3. 팝업에서 응용 프로그램 용 Microsoft Visual Basic 창에서 아래 VBA 코드를 복사하여 붙여 넣으십시오. 서브최종 하위 코드. 스크린 샷보기 :

VBA 코드 : Excel에서 이미지를 클릭하여 확대

Dim shp As Shape
    Dim big As Single, small As Single
    Dim shpDouH As Double, shpDouOriH As Double
    big = 3   
    small = 1 
    On Error Resume Next
    Set shp = ActiveSheet.Shapes(Application.Caller)
    With shp
        shpDouH = .Height
        .ScaleHeight 1, msoTrue, msoScaleFromTopLeft
        shpDouOriH = .Height
    
        If Round(shpDouH / shpDouOriH, 2) = big Then
            .ScaleHeight small, msoTrue, msoScaleFromTopLeft
            .ScaleWidth small, msoTrue, msoScaleFromTopLeft
            .ZOrder msoSendToBack
        Else
            .ScaleHeight big, msoTrue, msoScaleFromTopLeft
            .ScaleWidth big, msoTrue, msoScaleFromTopLeft
            .ZOrder msoBringToFront
        End If
    End With

주의 사항: 코드에서 big = 3 코드에서 그림의 큰 크기를 할당 할 수 있습니다.

4. 그런 다음 다른 + Q 키를 동시에 닫아 응용 프로그램 용 Microsoft Visual Basic 창.

이제부터 사진을 클릭하면 지정한 크기로 확대되고 다시 클릭하면 아래 스크린 샷과 같이 원래 크기로 복구됩니다.


관련 기사:

최고의 사무 생산성 도구

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

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

kte 탭 201905


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

  • Word, Excel, PowerPoint에서 탭 편집 및 읽기 사용, Publisher, Access, Visio 및 Project.
  • 새 창이 아닌 동일한 창의 새 탭에서 여러 문서를 열고 만듭니다.
  • 생산성을 50% 높이고 매일 수백 번의 마우스 클릭을 줄입니다!
Comments (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Lösung zu verpixelte Bilder
Ich hatte dasselbe Problem mit den verpixelten Bildern. Du musst in den Einstellungen etwas ändern und zwar:
Unter Datei/Optionen/Erweitert unter dem Punkt "Bildgröße und -Qualität" einen Hacken bei "Bilder nicht in Datei komprimieren" setzen. Dann zeigt es die Bilder nicht mehr verpixelt an. LG
This comment was minimized by the moderator on the site
Doesnt work
This comment was minimized by the moderator on the site
I know that a jpg loses quality each time it is saved.  That's why users are advised to save to a new filename.  This could be why people who try using this macro are ending up with blurred pictures.  A better approach would be to have two pictures - a large and small of the same photo.  The small is placed in the cell, the large in a different sheet, same file.  Then use code to show the large picture when the small picture is either clicked or hover over.  This way. neither picture gets resized and therefore should not lose quality.  I am not sure Kutools is able to do this.
This comment was minimized by the moderator on the site
The Macro works, the problem is that when you resize the the picture in the macro, if you go bellow 1, and save, the picture will lose it's quality :(
This comment was minimized by the moderator on the site
Hello, I'm trying to modify the the big (1) and small (0.1) values but the macro doesn't work properly. After some click the picture doesn't modify :(
This comment was minimized by the moderator on the site
THis is what i am looking for but it won't work with my excel 2016. I get an error message Application.caller = Error 2023
This comment was minimized by the moderator on the site
when u have inserted the code and press save the pics gets smaller and smaller... great idea but does not work i´m afraid...
This comment was minimized by the moderator on the site
This code works well
But when you open the workbook a second time, the images come out blurred
This comment was minimized by the moderator on the site
Maravilloso funciona perfecto!!!.
Hay forma que la imagen quede en el cento de la pantalla, solo es una oncesion, nada mas, la macro anda muy bien
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations