½Ð°Ý§Ú³oVBAþ¸Ì¦³°ÝÃD¡H¬°¤°»ò·|µLªk¥X²{ 424 µLªk§ä¨ìª«¥ó©O?
- ©«¤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
|
¦^´_ 4# jeffrey628litw
¸Õ¸Õ¬Ý- Option Explicit '±j¨î ¼Ò²ÕªºÅܼƥ²¶·n Dimªº«Å§i,·|¨Ïµ{¦¡©ö©ó°»¿ù
- Dim D As Object, Sh(1 To 2) As Worksheet '¼Ò²Õ³»ºÝ¤W DimªºÅÜ¼Æ ¥i¦bUserForm1ªº¥þ³¡µ{¦¡¤¤¨Ï¥Î
- Dim xTempPicture As String
- Private Sub UserForm_Initialize()
- Dim A As Range, S As String
- Set D = CreateObject("Scripting.Dictionary")
- Set Sh(1) = ThisWorkbook.Sheets("Database") '¤u§@ªí¦p¦³Åܰʮɦb¦¹×§ï§Y¥i
- Set Sh(2) = ThisWorkbook.Sheets.Add
- xTempPicture = "D:\IE.jpg"
- ¶×¤J¹Ï¤ù '¸ü¤Jªí³æµe±¹Ï¤ù
- With Sh(1)
- For Each A In .Range(.[E2], .[E2].End(xlDown))
- '**************************
- 'F10 ,F11 ¦³´«¦æ¦r¤¸ »Ýקï
- '¤j ¨¦µ¾¥
- 'Shohei Ohtan
- '***************************
- S = Replace(Trim(A), vbLf, Space(1)) '´«¦æ¦r¤¸ §ï¦¨ Space(1)
- Set D(S) = Range(A.Offset(, 1).Address)
- 'Debug.Print S, D(S).Address '«ü¥O:À˵ø->¤Î®Éµøµ¡¥i¬Ý¬Ý
- Next
- End With
- ComboBox1.List = D.KEYS
- Label1.WordWrap = False '¤º®e¦b¦æ¥½¬O§_¦Û°Ê´«¦æ
- With Image1 '³]©w¹Ï¤ùªºÅã¥Ü³]¼Ò¦¡
- .Picture = LoadPicture(xTempPicture)
- .PictureAlignment = fmPictureAlignmentCenter '2
- .PictureSizeMode = fmPictureSizeModeClip '0
- End With
- With Image2 '³]©w¹Ï¤ùªºÅã¥Ü³]¼Ò¦¡
- .Picture = LoadPicture(xTempPicture)
- .PictureAlignment = fmPictureAlignmentCenter '2
- .PictureSizeMode = fmPictureSizeModeClip '0
- End With
- End Sub
- Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
- Application.DisplayAlerts = False
- Sh(2).Delete
- Kill xTempPicture
- Application.DisplayAlerts = True
- End Sub
- Private Sub ComboBox1_Change()
- Dim A As Range
- Label1.Caption = "¨S¦³¦¹¹Ï¤ù"
- Image1.Picture = LoadPicture(xTempPicture) 'ªí³æ¹w³]ªº¹Ï¤ù
- Image2.Picture = LoadPicture(xTempPicture) 'ªí³æ¹w³]ªº¹Ï¤ù
- 'Image1.Visible = False '©Î¬OÁôÂÃ
- With ComboBox1
- If .ListIndex = -1 Then Exit Sub
- ¹Ï¤ùÀˬd D(.List(.ListIndex)).Address, Image1
- If ¹Ï¤ùÀˬd(D(.Value).Address, Image1) Then Label1.Caption = ComboBox1
- If .ListIndex < .ListCount - 1 Then ¹Ï¤ùÀˬd D(.List(.ListIndex + 1)).Address, Image2
- End With
- End Sub
- Private Function ¹Ï¤ùÀˬd(xPicture As String, xImage As Image) As Boolean
- Dim S As Shape, P As Object, xName As String
- For Each S In Sh(1).Shapes
- '*************************************************
- 'Shapeª«¥ó¬O·Ó¤ù¥B¦ì¸m¬OD(ComboBox1.Value).Address)
- If S.Type = msoPicture And S.TopLeftCell.Address = xPicture Then
- ¹Ï¤ùÀˬd = True
- Set P = S '.Copy '¹Ï¤ù½Æ»s
- Exit For
- End If
- '***************************************************
- Next
- If ¹Ï¤ùÀˬd = True Then
- xName = "D:\temp.jpg"
- ·Ó¤ùExport P, xName
- xImage.Picture = LoadPicture(xName) 'ªí³æÅã¥Ü¹Ï¤ù
- Kill xName ' "D:\temp.jpg" '§R°£¼È¦s¹Ï¤ù
- End If
- End Function
- Private Sub ·Ó¤ùExport(P As Object, xName As String)
- P.Copy
- With Sh(2).ChartObjects.Add(1, 1, P.Width, P.Height) '·s¼W¹Ïªí
- .Chart.Paste '¶K¤W¹Ï¤ù
- .Chart.Export xName '¶×¥X¹Ïªí¡A¼È¦s¹Ï¤ù
- .Delete '§R°£¹Ïªí
- End With
- End Sub
- Sub ¶×¤J¹Ï¤ù()
- Dim P As Picture
- With Sh(2)
- Set P = .Pictures.Insert("http://forum.twbts.com/templates/discuz6/images/logotop.png") '(¤u§@ªí¤W´¡¤J·Ó¤ù)
- With [a1] '«ü©wªºÀx¦s®æ
- P.Top = .Top '·Ó¤ùªº¥k¤è¦b¤u§@ªí¤Wªº¦ì¸m
- P.Left = .Left '·Ó¤ùªº¥k¤è¦b¤u§@ªí¤Wªº¦ì¸m
- .RowHeight = IIf(P.Height >= 409, 409, P.Height) '½Õ¾ãÀx¦s®æ°ª«×=>·Ó¤ùªº°ª«×
- P.Height = IIf(P.Height >= 409, 409, P.Height) '½Õ¾ãÀx¦s®æ°ª«×=>·Ó¤ùªº°ª«×
- If .Width < P.Width * (.ColumnWidth / .Width) Then '¤U¸ü·Ó¤ùªº³Ì¤j¼e«×
- .Width = P.Width * (.ColumnWidth / .Width)
- .ColumnWidth = P.Width * (.ColumnWidth / .Width) '½Õ¾ãÀx¦s®æÄæ¼e=>·Ó¤ùªº¼e«×
- End If
- End With
- End With
- ·Ó¤ùExport P, xTempPicture
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 228
- ¥DÃD
- 62
- ºëµØ
- 0
- ¿n¤À
- 364
- ÂI¦W
- 20
- §@·~¨t²Î
- Win 10
- ³nÅ骩¥»
- Office 2007 & 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-3-5
- ³Ì«áµn¿ý
- 2024-9-16
|
¦^´_ jeffrey628litw
¸Õ¸Õ¬Ý
GBKEE µoªí©ó 2018-6-13 08:26
½Ð°Ý§Ú·Qn«öDisplay Photo«ö¶s«á¡A
¤U©Ô¿ï³æ Player Name
¿ïMchael Jordan «á¥i¥H¥X²{
Image1¡G¬°F2¹Ï®×
Image2¬°F3¹Ï®×
Ãþ¦üEBAY ¿z¿ï§¹¦³°}¦C¹Ïªí¡AÃþ¦ü¤U¹Ï
Àɮצb¶³ºÝ http://webhd.xuite.net/_oops/jeffrey628litw/c6x |
|
|
|
|
|
|
- ©«¤l
- 228
- ¥DÃD
- 62
- ºëµØ
- 0
- ¿n¤À
- 364
- ÂI¦W
- 20
- §@·~¨t²Î
- Win 10
- ³nÅ骩¥»
- Office 2007 & 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-3-5
- ³Ì«áµn¿ý
- 2024-9-16
|
¦^´_ 2# GBKEE
ÁÂÁ G ¶W¯Åª©¥Dªº¦^ÂСA¥Ø«eµo²{³Ì«án¥[ End Function ´N¥i¥HRun¤F¡A¨ä¥LÁÙ¦b¬ã¨s¤¤¡A¶W¯Å·PÁ±zªºÀ°¦£¡C |
|
|
|
|
|
|
- ©«¤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
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2018-6-13 08:27 ½s¿è
¦^´_ 1# jeffrey628litw
¸Õ¸Õ¬Ý- Option Explicit '±j¨î ¼Ò²ÕªºÅܼƥ²¶·n Dimªº«Å§i,·|¨Ïµ{¦¡©ö©ó°»¿ù
- Dim D As Object, Sh As Worksheet '¼Ò²Õ³»ºÝ¤W DimªºÅÜ¼Æ ¥i¦bUserForm1ªº¥þ³¡µ{¦¡¤¤¨Ï¥Î
- Private Sub UserForm_Initialize()
- Dim A As Range, S As String
- Set D = CreateObject("Scripting.Dictionary")
- Set Sh = Sheets("Database") '¤u§@ªí¦p¦³Åܰʮɦb¦¹×§ï§Y¥i
- 'With Sheets("Database") ' ©Î¬O With Sheet1
- With Sh
- For Each A In .Range(.[E2], .[E2].End(xlDown))
- '**************************
- 'F10 ,F11 ¦³´«¦æ¦r¤¸ »Ýקï
- '¤j ¨¦µ¾¥
- 'Shohei Ohtan
- '***************************
- S = Replace(Trim(A), vbLf, Space(1)) '´«¦æ¦r¤¸ §ï¦¨ Space(1)
- Set D(S) = Range(A.Offset(, 1).Address)
- 'Debug.Print S, D(S).Address '«ü¥O:À˵ø->¤Î®Éµøµ¡¥i¬Ý¬Ý
- Next
- End With
- ComboBox1.List = D.keys
- Label1.WordWrap = False '¤º®e¦b¦æ¥½¬O§_¦Û°Ê´«¦æ
- With Image1 '³]©w¹Ï¤ùªºÅã¥Ü³]¼Ò¦¡
- .PictureAlignment = fmPictureAlignmentCenter '2
- .PictureSizeMode = fmPictureSizeModeClip '0
- End With
- End Sub
- Private Sub ComboBox1_Change()
- Dim A As Range
- Label1.Caption = "¨S¦³¦¹¹Ï¤ù"
- Image1.Picture = LoadPicture("") '¤£Åã¥Ü¹Ï¤ù
- 'Image1.Visible = False '©Î¬OÁôÂÃ
- If ComboBox1.ListIndex = -1 Then Exit Sub
- If ¹Ï¤ùÀˬd(D(ComboBox1.Value).Address) = False Then Exit Sub
- 'Image1.Visible = True 'Åã¥Ü
- End Sub
- Private Function ¹Ï¤ùÀˬd(xPicture As String) As Boolean
- Dim S As Shape, P As Object, xTop As Double
- For Each S In Sh.Shapes
- '*************************************************
- 'Shapeª«¥ó¬O·Ó¤ù¥B¦ì¸m¬OD(ComboBox1.Value).Address)
- If S.Type = msoPicture And S.TopLeftCell.Address = xPicture Then
- ¹Ï¤ùÀˬd = True
- S.Copy '¹Ï¤ù½Æ»s
- Set P = S
- Exit For
- End If
- '***************************************************
- Next
- If ¹Ï¤ùÀˬd = True Then
- With Sh
- Label1.Caption = ComboBox1
- With .ChartObjects.Add(1, 1, P.Width, P.Height) '·s¼W¹Ïªí
- .Chart.Paste '¶K¤W¹Ï¤ù
- .Chart.Export "D:\temp.jpg" '¶×¥X¹Ïªí¡A¼È¦s¹Ï¤ù
- .Delete '§R°£¹Ïªí
- End With
- Image1.Picture = LoadPicture("D:\temp.jpg") 'ªí³æÅã¥Ü¹Ï¤ù
- Kill "D:\temp.jpg" '§R°£¼È¦s¹Ï¤ù
- End With
- End If
½Æ»s¥N½X |
|
|
|
|
|
|