ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð±ÐÃö©ó¦p¦óÅý¨C¤@­Ósheetªº¹Ï¤ù§¡¦³ÂIÀ»©ñ¤jÁY¤p®ÄªG

¦^´_ 1# cmo140497
¸Õ¸Õ¬Ý
  1. Private Sub Workbook_Open()
  2.     Set dic = CreateObject("Scripting.Dictionary")
  3.     Dim Sh As Worksheet
  4.     Dim S As Shape                  'Shape: ¥Nªí¹Ï§Î¼h¤¤ªºª«¥ó¡A¦p§Ö¨ú¹Ï®×¡B¤âø¦hÃä§Î¡BOLE ª«¥ó©Î¹Ï¤ù
  5.    
  6.     For Each Sh In Sheets           'Sheets: ¤u§@ªí ª«¥óªº¶°¦X
  7.          For Each S In Sh.Shapes    'Shapes: Shape  ª«¥óªº¶°¦X
  8.         If S.Name Like "¹Ï¤ù*" Then S.OnAction = "nn": dic(S.Name & "h") _
  9.             = S.Height: dic(S.Name & "w") = S.Width
  10.         Next
  11.     Next
  12. End Sub

  13. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  14.   '*** ·s¼Wµ{¦¡:   ÁÙ­ì ¹Ï¤ùªº¤j¤p  ******
  15.     Dim Sh As Worksheet
  16.     Dim S As Shape                  'Shape: ¥Nªí¹Ï§Î¼h¤¤ªºª«¥ó¡A¦p§Ö¨ú¹Ï®×¡B¤âø¦hÃä§Î¡BOLE ª«¥ó©Î¹Ï¤ù
  17.     For Each Sh In Sheets           'Sheets: ¤u§@ªí ª«¥óªº¶°¦X
  18.          For Each S In Sh.Shapes    'Shapes: Shape  ª«¥óªº¶°¦X
  19.         If S.Name Like "¹Ï¤ù*" Then S.Height = dic(S.Name & "h"): S.Width = dic(S.Name & "w")
  20.         Next
  21.     Next
  22. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-1-9 15:24 ½s¿è

¦^´_ 5# cmo140497
·s¼W¹Ï¤ù¬O¤£¬O¤@©w±o¦sÀÉ: ¥iÀH§Aªº·N.
Sheet1 4­Ó¹Ï¤ù¦WºÙ¬° Picture 1,Picture 2,¹Ï¤ù 1,¹Ï¤ù 2
Sheet2 3­Ó¹Ï¤ù¦WºÙ¬° ¹Ï¤ù 3,¹Ï¤ù 2,¹Ï¤ù 1
If Sh.Name Like "¹Ï¤ù*" Then   : µLªkŪ¥XSheet1  Picture 1,Picture 2 ªº¹Ï¤ù
­×§ï¥H ¹Ï®×Ãþ«¬= ·Ó¤ù,§@¬°§PÂ_.
  1. Private Sub Workbook_Open()
  2.     Set dic = CreateObject("Scripting.Dictionary")
  3.     Dim Sh As Worksheet
  4.     Dim S As Shape                          'Shape: ¥Nªí¹Ï§Î¼h¤¤ªºª«¥ó¡A¦p§Ö¨ú¹Ï®×¡B¤âø¦hÃä§Î¡BOLE ª«¥ó©Î¹Ï¤ù
  5.     For Each Sh In Sheets                   'Sheets: ¤u§@ªí ª«¥óªº¶°¦X
  6.         For Each S In Sh.Shapes             'Shapes: Shape  ª«¥óªº¶°¦X
  7.             If S.Type = msoPicture Then     'S.Type(¹Ï®×Ãþ«¬): ·Ó¤ù
  8.                 S.OnAction = "nn"
  9.                 dic(S.Name & "h") = S.Height
  10.                 dic(S.Name & "w") = S.Width
  11.             End If
  12.         Next
  13.     Next
  14. End Sub
  15. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  16.   '*** ·s¼Wµ{¦¡:   ÁÙ­ì ¹Ï¤ùªº¤j¤p  ******
  17.     Dim Sh As Worksheet
  18.     Dim S As Shape                  'Shape: ¥Nªí¹Ï§Î¼h¤¤ªºª«¥ó¡A¦p§Ö¨ú¹Ï®×¡B¤âø¦hÃä§Î¡BOLE ª«¥ó©Î¹Ï¤ù
  19.     For Each Sh In Sheets           'Sheets: ¤u§@ªí ª«¥óªº¶°¦X
  20.         For Each S In Sh.Shapes    'Shapes: Shape  ª«¥óªº¶°¦X
  21.             If S.Type = msoPicture Then S.Height = dic(S.Name & "h"): S.Width = dic(S.Name & "w")
  22.         Next
  23.     Next
  24. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ÀR§¤±`®¦¤v¹L¡B¶¢½Í²ö½×¤H«D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD