- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# hong912
UserFormªºµ{¦¡½X- Option Explicit '¦b¼Ò²Õ¼h¦¸¤¤±j¢¨CÓ¦b¼Ò²ÕùتºÅܼƳ£¥²¶·©ú½Tªº«Å§i¡C
- Private Const ½s¸¹ = 3 '¸ê®Æ®wªºÄæ¦ì¦C¸¹
- Private Const ThePicture = "d:\ttt.gif" '³]¥ß¶×¥X¹Ï¤ùªº¸ô®|ÀɦW
- Dim Ar(10), Sh As Worksheet
- 'Dim Ar()
- Private Sub UserForm_Initialize() 'ªí³æªì©l¤Æªº¹w³]¨Æ¥óµ{§Ç
- Dim I As Integer
- Set Sh = Sheets("Sheet1") '¸ê®Æ®wªº¤u§@ªí
- With Sh
- ComboBox1.List = .Range("a4", .[a4].End(xlDown)).Value '«ü©w ComboBox1ªº¤º®e
- End With
- 'Dim Ar()®É¥i¥Î¤U¦¡
- 'Ar = Array(TextBox1, TextBox2, TextBox3, TextBox4, TextBox5, TextBox6, TextBox7, TextBox8, TextBox9, TextBox10, TextBox11)
- For I = 0 To UBound(Ar)
- Set Ar(I) = Me.Controls("TextBox" & I + 1) '°}¦Cªº¤¸¯À³]¬°TextBox (ª«¥ó)
- Next
- Image1.PictureSizeMode = fmPictureSizeModeStretch
- '°Ñ¼ÆfmPictureSizeModeStretch= 1 :½Õ¾ã¹Ï¤ù¤j¤p¥H¶ñº¡ªí³æ©Î¬¡¶¡A¦¹³]©w·|³y¦¨¹Ï¤ùªº¤ô¥»P««ª½¤è¦V¤ñ¨Ò³Q§á¦±¡C
- End Sub
- Private Sub ComboBox1_Change()
- Dim Sp As Picture, I As Integer
- If ComboBox1.ListIndex > -1 Then '¿ï¾Ü ComboBox1ªº¤º®e
- For I = 0 To UBound(Ar)
- Ar(I).Text = Sh.Cells(½s¸¹ + ComboBox1, I + 2)
- Next
- End If
- With Sh
- For Each Sp In .Pictures '´M§äNÄ椤ªº¹Ï¤ù,½Æ»s¤§
- If Sp.TopLeftCell.Address(0, 0) = "N" & ½s¸¹ + ComboBox1 Then Sp.Copy: Exit For
- Next
- '§Q¥Î¹Ïªí¶×¥X¦sÀÉ
- With .ChartObjects.Add(1, 1, Sp.Width, Sp.Height) '·s¼W ¹Ïªí
- .Chart.Paste '¶K¤W ¹Ï¤ù
- .Chart.Export Filename:=ThePicture '¶×¥X ¹Ï¤ù
- .Delete '§R°£ ¹Ïªí
- End With
- End With
- Image1.Picture = LoadPicture(ThePicture) 'Image1 «ü©w¹Ï¤ù
- End Sub
- Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) 'ªí³æµ´§ô®É ¹w³]¨Æ¥óµ{§Ç
- If Dir(ThePicture) <> "" Then Kill ThePicture '§R°£ ¶×¥Xªº¹Ï¤ù
- End Sub
½Æ»s¥N½X |
|