½Ð°Ý§Ú³oVBAþ¸Ì¦³°ÝÃD¡H¬°¤°»ò·|µLªk¥X²{ 424 µLªk§ä¨ìª«¥ó©O?
- ©«¤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
|
½Ð°Ý§Ú³oVBAþ¸Ì¦³°ÝÃD¡H¬°¤°»ò·|µLªk¥X²{ 424 µLªk§ä¨ìª«¥ó©O?
½Ð°Ý¦U¦ì«e½ú¥ý¶i
¦p¦óÅý³oÀÉ®×
¯à¦Û°Ê¸õ¥X¦h±i¹Ï¤ù¤Î¹ïÀ³¸ê®Æ)-^¤åª©-02.rar (341.33 KB)
¥i¥H¹³¥kÃä³oÀɮ׶}±Ò¹ÏÀÉ©O?
20180611 VBA Ū¨ú¹Ï¤ù v.02.zip (43.52 KB)
¥kÃ䪺ÀÉ®× ¹Ï¤ù¦p¤U¡G
½Ð°Ý§Ú³oVBAþ¸Ì¦³°ÝÃD¡H¬°¤°»ò·|µLªk¥X²{ 424 µLªk§ä¨ìª«¥ó©O?
Private Sub ComboBox1_Change()
Dim a As Range
Application.ScreenUpdating = False
With Database
Set a = .Columns("E").Find(ComboBox1, lookat:=xlWhole)
Label1.Caption = a.Offset(, 1)
a.Offset(, 1).CopyPicture '½Æ»s¦¨¹Ï¤ù a.Offset(, 1). 1¬°¶Ç¦^¤W1¦æµ{¦¡ a = .Columns("E").«á1®æÀx¦s®æªº¹Ï¤ù
With .ChartObjects.Add(1, 1, a.Offset(, 2).Width, a.Offset(, 2).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
Application.ScreenUpdating = True
End Sub
Private Sub UserForm_Initialize()
Dim a As Range
Set d = CreateObject("Scripting.Dictionary")
With Database
For Each a In .Range(.[E2], .[E2].End(xlDown))
d(a.Value) = ""
Next
End With
ComboBox1.List = d.keys
End Sub
-------------------------------------------------------------------
ÁÂÁ¦U¦ì |
|
|
|
|
|
|
- ©«¤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 |
|
|
|
|
|
|
- ©«¤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
- 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
- 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
|
|
|
|
|
|
|
- ©«¤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
|
¦^´_ 6# jeffrey628litw
¦A¸Õ¸Õ- Option Explicit '±j¨î ¼Ò²ÕªºÅܼƥ²¶·n Dimªº«Å§i,·|¨Ïµ{¦¡©ö©ó°»¿ù
- Dim Sh(1 To 2) As Worksheet, xTempPicture As String '¼Ò²Õ³»ºÝ¤W DimªºÅÜ¼Æ ¥i¦bUserForm1ªº¥þ³¡µ{¦¡¤¤¨Ï¥Î
- Private Sub UserForm_Initialize()
- Dim A As Range, i As Integer
- Set Sh(1) = ThisWorkbook.Sheets("Database") '¤u§@ªí¦p¦³Åܰʮɦb¦¹×§ï§Y¥i
- Set Sh(2) = ThisWorkbook.Sheets.Add
- ¶×¤J¹Ï¤ù '¸m¤J"¨S¦³¹Ï¤ù"ÀÉ
- '¤£n¥Î¦r¨åª«¥ó Set D = CreateObject("Scripting.Dictionary")
- With ComboBox1
- For Each A In Sh(1).Range(Sh(1).[E3], Sh(1).[E3].End(xlDown))
- 'ColumnCount ÄÝ©Ê Y±N ColumnCount ³]¦¨ 0¡AÅã¥Üªº¦æ¼Æ«K¬O 0¡FY³]¦¨ -1¡A«KÅã¥Ü©Ò¦³ªº¸ê®Æ¦æ¡C¹ï¤@Ó«D¸ê®Æ³sµ²ªº¸ê®Æ¨Ó·½¦Ó¨¥¡A³Ì¦h¥u¯à¦³ 10 ¦æ (0 ¨ì 9)¡C
- .ColumnCount = 2 '¤F¸Ñ«á,¥i¤£¥Î¦¹¦æµ{¦¡½X?
- .AddItem
- .List(.ListCount - 1, 0) = A
- .List(.ListCount - 1, 1) = A.Offset(, 1).Address
- Next
- End With
- Label1.WordWrap = False '¤º®e¦b¦æ¥½¬O§_¦Û°Ê´«¦æ
- Label4.WordWrap = False '*******·s¼WLabel±±¨î¶µ
-
- 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¦³¦¹¹Ï¤ù"
- Label4.Caption = "¨S¦³¦¹¹Ï¤ù" '*******·s¼WLabel±±¨î¶µ
- Image1.Picture = LoadPicture(xTempPicture) 'ªí³æ¹w³]ªº¹Ï¤ù
- Image2.Picture = LoadPicture(xTempPicture) 'ªí³æ¹w³]ªº¹Ï¤ù
- With ComboBox1
- If .ListIndex = -1 Then Exit Sub
- If ¹Ï¤ùÀˬd(.List(.ListIndex, 1), Image1) = True Then Label1.Caption = .Value
- If .ListIndex < .ListCount - 1 Then
- If ¹Ï¤ùÀˬd(.List(.ListIndex + 1, 1), Image2) Then Label4.Caption = .List(.ListIndex + 1, 0)
- '*******·s¼WLabel±±¨î¶µ
- End If
- 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 Range
- xTempPicture = "D:\NoPicture.jpg"
- Set P = Sh(1).[f2]
- P.CopyPicture
- With Sh(2).ChartObjects.Add(1, 1, P.Width, P.Height) '·s¼W¹Ïªí
- .Chart.Paste '¶K¤W¹Ï¤ù
- .Chart.Export xTempPicture '¶×¥X¹Ïªí¡A¼È¦s¹Ï¤ù
- .Delete '§R°£¹Ïªí
- End With
- 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
|
¦^´_ 7# GBKEE
G¤j ¶W¯Åª©¥D±z¦n¡A§Ú¬Ý±z¤w¸g¦³±N§Ú°ÝÃD1¸Ñ¨M¤F¡A¥t¥~nµ{¦¡¤¤»¡©ún·s¼W Lable4 §Ú¤]·s¼W¤F¡A
°ÝÃD2©M3ÁÙ¨S¸Ñ¨M¡A
±µ¤U¨Ó¡A
µ{¦¡ªºÅÞ¿è¬On¨Ì¾Ú¼´¥XªºLable4 ¦pªGµ²ªG¦PLable1ªº¦r¦ê¡A«h¼´¥X¹Ï¤ù¡A§_«h¼´¥XNullªº¹Ï¤ù¶Ü?
¬O³o¼Ëªº¸Ü½Ð°Ýn¦p¦ó¼g©O? ¦]¬°§Ú¹ï©óVBA¹ê¦b´X¥G§¹¥þ¤£¤F¸Ñ¡A¯à§_½Ð±zÀ°¦£¤@ÂI¤@ÂI¸Ñµ¹§Ú¬Ý¡A§ÚºCºC¾Ç©O?
ÁÂÁ±z¡C
Àɮצb¶³ºÝ¡Ghttp://webhd.xuite.net/_oops/jeffrey628litw/wyh |
|
|
|
|
|
|
- ©«¤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-16 06:26 ½s¿è
¦^´_ 8# jeffrey628litw
¹ï©óVBA¤£¤F¸Ñ,¥i¦h¬Ý¬Ý½×¾Âªº¥DÃD¤ÎVBA¤W»¡©ú,¨Ã¦h½m²ß,·|¶i¨Bªº
¤£À´¥i´£°Ý.¤º®eÅý¤H¬ÝÀ´´N·|±o¨ì¦^ÂÐ(¸q°È©Ê)
¦p¦³¤£²Å,½Ð¦A¸Ô¥[»¡©ú- Option Explicit '±j¨î ¼Ò²ÕªºÅܼƥ²¶·n Dimªº«Å§i,·|¨Ïµ{¦¡©ö©ó°»¿ù
- Dim Sh(1 To 2) As Worksheet, D As Object, xTempPicture As String '¼Ò²Õ³»ºÝ¤W DimªºÅÜ¼Æ ¥i¦bUserForm1ªº¥þ³¡µ{¦¡¤¤¨Ï¥Î
- Private Sub UserForm_Initialize()
- Dim A As Range, S As String
- Set Sh(1) = ThisWorkbook.Sheets("Database") '¤u§@ªí¦p¦³Åܰʮɦb¦¹×§ï§Y¥i
- Set Sh(2) = ThisWorkbook.Sheets.Add
- xTempPicture = "D:\NoPicture.jpg"
- ·Ó¤ùExport Sh(1).Range("F2"), xTempPicture '¸m¤J"¨S¦³¹Ï¤ù"ÀÉ
- Set D = CreateObject("Scripting.Dictionary")
- For Each A In Sh(1).Range(Sh(1).[E3], Sh(1).[E3].End(xlDown))
- S = Replace(Trim(A), vbLf, Space(1)) '´«¦æ¦r¤¸ §ï¦¨ Space(1)
- If D.EXISTS(S) Then
- D(S) = D(S) & "," & A.Offset(, 1).Address
- Else
- D(S) = A.Offset(, 1).Address
- End If
- Next
- ComboBox1.List = D.KEYS
- Label1.WordWrap = False '¤º®e¦b¦æ¥½¬O§_¦Û°Ê´«¦æ
- Label4.WordWrap = False '*******·s¼WLabel±±¨î¶µ
- 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 Variant, i As Integer, S As String
- Label1.Caption = "¨S¦³¦¹¹Ï¤ù"
- Label4.Caption = "¨S¦³¦¹¹Ï¤ù" '*******·s¼WLabel±±¨î¶µ
- Image1.Picture = LoadPicture(xTempPicture) 'ªí³æ¹w³]ªº¹Ï¤ù
- Image2.Picture = LoadPicture(xTempPicture) 'ªí³æ¹w³]ªº¹Ï¤ù
- With ComboBox1
- If .ListIndex = -1 Then Exit Sub
- A = Split(D(.Value), ",")
- For i = 0 To 1
- If i <= UBound(A) Then
- S = A(i)
- If ¹Ï¤ùÀˬd(S, IIf(i = 0, Image1, Image2)) Then Label1.Caption = .Value
- End If
- Next
- Label4.Visible = UBound(A) = 0 '¦³¬Û¦Pªº Player Name «h¤£Åã¥Ü
- If UBound(A) = 0 And .ListIndex < .ListCount - 1 Then
- A = Split(D(.List(.ListIndex + 1)), ",")
- S = A(0)
- If ¹Ï¤ùÀˬd(S, Image2) Then Label4.Caption = .List(.ListIndex + 1, 0)
- '*******·s¼WLabel±±¨î¶µ
- End If
- End With
- End Sub
- Private Function ¹Ï¤ùÀˬd(xPicture As String, xImage As Image) As Boolean
- Dim S As Shape, 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
- Exit For
- End If
- '***************************************************
- Next
- If ¹Ï¤ùÀˬd = True Then
- xName = "D:\temp.jpg"
- ·Ó¤ùExport S, 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)
- If xName <> "D:\temp.jpg" Then
- P.CopyPicture
- Else
- P.Copy
- End If
- 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
½Æ»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
|
¦^´_ 9# GBKEE
G¤j ª©¥D±z¦n¡G§Ú¬Ý¤F°ÝÃD3¤]¸Ñ¨M¤F¡A³Ñ¤U°ÝÃD2¡A³oÅÞ¿è¬On¼g
·íLable1 And Lable4 ¤£¬°ªÅ®É¥B¤£¬Û¦P¡A«hÅã¥Ü2±i¹Ï¤ù¨ìImage1 ©MImage4¡A
§_«h ·íLable1¤£µ¥©ó Label4¡A«hÅã¥ÜImage1 ¥B Image4¬°ªÅ
§_«h ·íLabel1µ¥©óªÅ¡ALable4¤£µ¥©óªÅ¡A«hÅã¥ÜImage1¬°ªÅ ¥BÅã¥Ü Image4ªº¹Ï¤ù
¬O³o¼Ë¤l¶Ü? ¬Oªº¸Üµ{¦¡n«ç»ò¼g©O?¦A½Ð±z½ç±Ð¡AÁÂÁ¡C
¶³ºÝÀɮסGhttp://webhd.xuite.net/_oops/jeffrey628litw/gdn |
|
|
|
|
|
|