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

excel ³ø»ùªí³æ¤W¿é¤J¤£¦PªºItem¦p¦ó±a¤J¤£¦Pªº¹Ï¤ù

excel ³ø»ùªí³æ¤W¿é¤J¤£¦PªºItem¦p¦ó±a¤J¤£¦Pªº¹Ï¤ù

½Ð°Ý¦U¦ì°ª¤â,§Ú¦bexcel ªí³æ¤Wªº¹Ï¤ù(Image)
·Q¨Ì·Óªí³æ¤W¿é¤J¤£¦PªºItem±a¤J¤£¦Pªº¹Ï¤ù(¹Ï¤ùÀx¦s¦bD:\catalogue¸Ì)
µ{¦¡½XÀ³¸Ó­n«ç»ò¼g??

³ø»ù³æ.rar (27.66 KB)

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-2-19 14:35 ½s¿è

¦^´_ 1# h99949
  1. Const ¹w³]·Ó¤ùºô§} = "http://blog-imgs-27-origin.fc2.com/p/o/k/pokomin/TOTAL.jpg"
  2. Const ¹w³]·Ó¤ù = "d:\·Ó¤ù.gif"
  3. Private Sub UserForm_Initialize()  '¶}±Òªí³æªì©lµ{¦¡
  4.     ¤U¸üºô¸ô¹Ï¤ù
  5.      With Image1
  6.         .Picture = LoadPicture(¹w³]·Ó¤ù)          '¸ü¤J¹Ï¤ù
  7.         .PictureSizeMode = fmPictureSizeModeZoom  '¹Ï¤ù¼Ò¦¡
  8.      End With
  9.      TextBox1.SetFocus
  10. End Sub
  11. Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) 'ªí³æÃö³¬
  12.     Kill ¹w³]·Ó¤ù '§R°£
  13. End Sub
  14. Private Sub TextBox1_Change()
  15.     If TextBox1.Value = "" Then Exit Sub
  16.     Dim cell As Range
  17.     Set cell = Sheets("ÂøµæÁç").Columns(1).Find(TextBox1.Value, lookat:=xlWhole)
  18.     If Not cell Is Nothing Then
  19.         If Dir("D:\catalogue\" & cell & ".*") <> "" Then
  20.             Image1.Picture = LoadPicture("d:\catalogue\" & Dir("D:\catalogue\" & cell & ".*"))
  21.         End If
  22.         TextBox2.Value = cell.Offset(, 1).Value
  23.         TextBox3.Value = cell.Offset(, 2).Value
  24.         TextBox4.Value = cell.Offset(, 3).Value
  25.         TextBox5.Value = cell.Offset(, 4).Value
  26.         TextBox6.Value = cell.Offset(, 5).Value
  27.         TextBox7.Value = cell.Offset(, 32).Value
  28.         TextBox8.Value = cell.Offset(, 33).Value
  29.     Else
  30.        Image1.Picture = LoadPicture(¹w³]·Ó¤ù)
  31.         TextBox2.Value = ""
  32.         TextBox3.Value = ""
  33.         TextBox4.Value = ""
  34.         TextBox5.Value = ""
  35.         TextBox6.Value = ""
  36.         TextBox7.Value = ""
  37.         TextBox8.Value = ""
  38.     End If
  39. End Sub
  40. Private Sub TextBox1_AfterUpdate()
  41.     If TextBox2.Value = "" Then
  42.         TextBox2.SetFocus
  43.     Else
  44.         CommandButton2.SetFocus
  45.     End If
  46. End Sub
  47. Private Sub ¤U¸üºô¸ô¹Ï¤ù()
  48.     Dim xml As Object     '¥Î¨Ó¨ú±oºô­¶¸ê®Æ
  49.     Dim stream            'As ADODB.stream   '¥Î¨ÓÀx¦s¤G¶i¦ìÀÉ®×
  50.     Set xml = CreateObject("Microsoft.XMLHTTP")
  51.     Set stream = CreateObject("ADODB.stream")
  52.         xml.Open "GET", ¹w³]·Ó¤ùºô§}, 0
  53.         xml.send
  54.     With stream
  55.         .Open
  56.         .Type = 1
  57.         .write xml.ResponseBody
  58.         If Dir(¹w³]·Ó¤ù) <> "" Then Kill ¹w³]·Ó¤ù
  59.         .SaveToFile (¹w³]·Ó¤ù)
  60.         .Close
  61.     End With
  62.     Set xml = Nothing
  63.     Set stream = Nothing
  64. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

§A¦n,¹Ï¤ù¬O©ñ¦b¹q¸£ªºD:\catalogue¸Ì¨Ã¤£¬Oºô§}¸Ì,½Ð°Ýµ{¦¡¸Ó¦p¦ó­×§ï?

TOP

¹Ï¤ù¤£¬O©T©wªº¥¦¬O¥i¥H¨Ì¿é¤Jªº¸ê®Æ¤£¦P§@ÅܤÆ

TOP

¦^´_ 2# GBKEE
¥i¥H±N¹w³]ªº·Ó¤ù§ï¦¨¹q¸£¸Ìªº¹Ï¤ù¶Ü?

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-2-19 14:37 ½s¿è

¦^´_ 5# h99949
¹Ï¤ù¬O©ñ¦b¹q¸£ªºD:\catalogue¸Ì¨Ã¤£¬Oºô§}¸Ì,½Ð°Ýµ{¦¡¸Ó¦p¦ó­×§ï?
¹Ï¤ù¤£¬O©T©wªº¥¦¬O¥i¥H¨Ì¿é¤Jªº¸ê®Æ¤£¦P§@ÅܤÆ
¥i¥H±N¹w³]ªº·Ó¤ù§ï¦¨¹q¸£¸Ìªº¹Ï¤ù¶Ü?
  1. Const ¹w³]·Ó¤ù = "d:\·Ó¤ù.gif"  '³o¤£¬O¹q¸£¸Ìªº¹Ï¤ù¶Ü
  2. Private Sub TextBox1_Change()
  3.     If TextBox1.Value = "" Then Exit Sub
  4.     Dim cell As Range
  5.     Set cell = Sheets("ÂøµæÁç").Columns(1).Find(TextBox1.Value, lookat:=xlWhole)
  6.     If Not cell Is Nothing Then  
  7.         If Dir("D:\catalogue\" & cell & ".*") <> "" Then  
  8.              '*** ¦b¹q¸£ªºD:\ ¤w§ó¥¿ D:\catalogue     ******
  9.             ' *** ¨Ì TextBox1.Value ¦³ÅÜ¤Æ ******
  10.             Image1.Picture = LoadPicture("d:\catalogue\" & Dir("D:\catalogue\" & cell & ".*"))
  11.             'TextBox1.Value-> "d:\catalogue\" & Dir("D:\catalogue\" & cell & ".*")
  12.         End If
  13.     Else
  14.        Image1.Picture = LoadPicture(¹w³]·Ó¤ù)
  15.      End If
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 6# GBKEE
ª©¥D§A¦n,¤w¸g¥H¥Î¤F,ÁÂÁÂ
¦ý§Ú·Q¦bªí³æ¿é¤JItem«á±a¥X¨Óªº¬ÛÃö¸ê®Æ,¥i¥H¦bªí³æ¤W­×§ï«áª½±µÀx¦s¨ì¬Û¹ïÀ³ªºÀx¦s®æ¤W,µ{¦¡À³¸Ó¦p¦ó°µ­×§ï©O?

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-2-21 13:57 ½s¿è

¦^´_ 7# h99949
  1. Option Explicit         '±j¨î«Å§iÅܼÆ
  2. Option Base 1           '°}¦Cªº¯Á¤Þ­È,«ü©w¤U­­­È¬° 1
  3. Const ¹w³]·Ó¤ùºô§} = "http://blog-imgs-27-origin.fc2.com/p/o/k/pokomin/TOTAL.jpg" '«ü©w±`¼Æ
  4. Const ¹w³]·Ó¤ù = "d:\·Ó¤ù.gif"
  5. Dim Rng As Range, Text_Ar(), AR(), Rng_Text As String

  6. Private Sub UserForm_Initialize()   '¶}±Òªí³æªì©lµ{¦¡
  7.     Dim i As Integer
  8.     For i = 1 To 7
  9.         ReDim Preserve Text_Ar(1 To i)
  10.         Set Text_Ar(i) = Me.Controls("TextBox" & i + 1) '±N±±¨î¶µ"TextBox?" ¸m¤J°}¦C¤¤
  11.     Next
  12.     AR = Array(1, 2, 3, 4, 5, 32, 33)   '³f¸¹¸ê®Æªº¦ì¸m
  13.     TextBox1.SetFocus
  14.     ¤U¸üºô¸ô¹Ï¤ù
  15.     With Image1
  16.         .Picture = LoadPicture(¹w³]·Ó¤ù)          '¸ü¤J¹Ï¤ù
  17.         .PictureSizeMode = fmPictureSizeModeZoom  '¹Ï¤ù¼Ò¦¡
  18.     End With
  19. End Sub

  20. Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) 'ªí³æÃö³¬
  21.     Kill ¹w³]·Ó¤ù '§R°£
  22. End Sub

  23. Private Sub TextBox1_Change()
  24.     Dim i As Integer
  25.     If TextBox1.Value = "" Then Exit Sub
  26.     Set Rng = Sheets("ÂøµæÁç").Columns(1).Find(TextBox1.Value, lookat:=xlWhole)
  27.     If Not Rng Is Nothing Then
  28.         If Dir("D:\catalogue\" & Rng & ".*") <> "" Then
  29.            Image1.Picture = LoadPicture("d:\catalogue\" & Dir("D:\catalogue\" & Rng & ".*"))
  30.         End If
  31.         Rng_Text = ""                                              '²M°£ °O¾Ð¸ê®Æ
  32.         For i = 1 To UBound(AR)
  33.             Rng_Text = Rng_Text & Rng.Offset(, AR(i))   '°O¾Ð¸ê®Æ
  34.             Text_Ar(i).Text = Rng.Offset(, AR(i)).Value '¾É¤J¸ê®Æ¦bTextBox?
  35.             'Rng.Offset(, i).Text  :Àx¦s®æÅã¥Üªº¼Æ¦r®æ¦¡
  36.             'Rng.Offset(, i).Value :Àx¦s®æ¯u¥¿ªº¼Æ¦r
  37.             'Åã¥Üªº¼Æ¦r®æ¦¡,¤£¤@©wµ¥©ó,¯u¥¿ªº¼Æ¦r.
  38.         Next
  39.     Else
  40.        Image1.Picture = LoadPicture(¹w³]·Ó¤ù)
  41.         For i = 1 To UBound(AR)
  42.             Text_Ar(i).Text = ""
  43.         Next
  44.     End If
  45. End Sub

  46. Private Sub TextBox1_AfterUpdate()
  47.     If TextBox2.Value = "" Then
  48.         TextBox2.SetFocus
  49.     Else
  50.         CommandButton2.SetFocus
  51.     End If
  52. End Sub

  53. Private Sub CommandButton1_Click()
  54.     Dim s As String, i As Integer
  55.     If Rng Is Nothing Then
  56.         s = "³f¸¹¤¤¨S¦³ " & TextBox1
  57.     ElseIf Rng_Text = Join(Text_Ar, "") Then
  58.         s = "³f¸¹" & TextBox1 & "¸ê®Æ¨S¦³­×§ï !!"
  59.     End If
  60.     If s = "" Then
  61.         If MsgBox(TextBox1 & "­×§ï¸ê®Æ !!", 32 + vbYesNo) = vbYes Then
  62.             For i = 1 To UBound(AR)
  63.                 Rng.Offset(, AR(i)).Value = Text_Ar(i) '¾É¤JTextBox?¼Æ¦r(¤å¦r«¬ºA)¨ìRng
  64.                 Rng.EntireRow = Rng.EntireRow.Value '¼Æ¦r(¤å¦r«¬ºA)Âର ¼Æ¦r(¼Æ¦r«¬ºA)
  65.             Next
  66.         End If
  67.     End If
  68. End Sub

  69. Private Sub ¤U¸üºô¸ô¹Ï¤ù()
  70.     Dim xml As Object     '¥Î¨Ó¨ú±oºô­¶¸ê®Æ
  71.     Dim stream            'As ADODB.stream   '¥Î¨ÓÀx¦s¤G¶i¦ìÀÉ®×
  72.     Set xml = CreateObject("Microsoft.XMLHTTP")
  73.     Set stream = CreateObject("ADODB.stream")
  74.         xml.Open "GET", ¹w³]·Ó¤ùºô§}, 0
  75.         xml.send
  76.     With stream
  77.         .Open
  78.         .Type = 1
  79.         .write xml.ResponseBody
  80.         If Dir(¹w³]·Ó¤ù) <> "" Then Kill ¹w³]·Ó¤ù
  81.         .SaveToFile (¹w³]·Ó¤ù)
  82.         .Close
  83.     End With
  84.     Set xml = Nothing
  85.     Set stream = Nothing
  86. End Sub

  87. Private Sub cal_Click()
  88.     Dim x As Integer, y As Integer, s As String
  89.     x = Val(mypv)                       '³æ»ù
  90.     y = Val(myrate)
  91.     If y <> 0 Then s = Round(x / y, 2)  '¶×²v
  92.     ratepay.Caption = s
  93. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 8# GBKEE
Private Sub TextBox1_Change()Åܼƥ¼©w¸q¸Ó¦p¦ó­×§ï

¥¼©R¦W.JPG (196.99 KB)

¥¼©R¦W.JPG

TOP

¦^´_ 9# h99949
  1. Option Explicit         '±j¨î«Å§iÅܼÆ
  2. Option Base 1           '°}¦Cªº¯Á¤Þ­È,«ü©w¤U­­­È¬° 1
  3. Const ¹w³]·Ó¤ùºô§} = "http://blog-imgs-27-origin.fc2.com/p/o/k/pokomin/TOTAL.jpg" '«ü©w±`¼Æ
  4. Const ¹w³]·Ó¤ù = "d:\·Ó¤ù.gif"
  5. Dim Rng As Range, Text_Ar(), AR(), Rng_Text As String  '³o¸Ì¦³¶Ü?
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¨ü¤HÂI¤ô¤§®¦¡A¶··í´é¬u¥H³ø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD