Skip to main content

Conas an íomhá a mhéadú nuair a chliceálann sí uirthi in Excel?

Má ghlactar leis go bhfuil liosta pictiúr curtha isteach agat i gcolún agus na méideanna pictiúr a mheaitseáil leis na méideanna cille mar atá thíos an pictiúr a thaispeántar. Toisc go bhfuil cuma bheag ar an bpictiúr a cuireadh isteach, b’fhéidir go mbeidh ort é a mhéadú chun críocha áirithe. Taispeánfaidh an t-alt seo modh duit chun pictiúr a mhéadú nuair a chliceálann tú air in Excel, agus chun teacht ar ais go dtí an méid bunaidh faoin dara cliceáil.

Méadaigh an íomhá nuair a chliceálann sí uirthi le cód VBA


Méadaigh an íomhá nuair a chliceálann sí uirthi le cód VBA

Is féidir leis an gcód VBA seo a leanas cabhrú leat íomhá a mhéadú nuair a chliceálann tú air in Excel. Déan mar a leanas le do thoil.

1. Cliceáil ar dheis ar an bpictiúr a chaithfidh tú a mhéadú ach cliceáil air, ansin cliceáil Macra a shannadh ón roghchlár comhthéacs. Féach an pictiúr:

2. Sa Macra a shannadh bosca dialóige, cliceáil le do thoil ar an Nua cnaipe.

3. Sa popping suas Microsoft Visual Basic d’Fheidhmchláir fuinneog, cóipeáil agus greamaigh an cód VBA thíos idir an Fo agus Fo Deireadh cóid. Féach an pictiúr:

Cód VBA: Méadaigh an íomhá trí chliceáil uirthi in 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

nótaí: Sa chód, is féidir leat méideanna móra an phictiúr a shannadh sa chód mór = 3.

4. Ansin brúigh an Eile + Q eochracha ag an am céanna chun an Microsoft Visual Basic d’Fheidhmchláir fhuinneog.

As seo amach, nuair a chliceálann tú ar an bpictiúr, méadófar é go dtí an méid a shonraigh tú, agus cliceáil arís gheobhaidh sé ar ais go dtí an méid bunaidh mar atá thíos na scáileáin scáileáin a thaispeántar.


Earraí gaolmhara:

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 (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