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

[µo°Ý] ¦p¦ó¸g¥Ñªí³æªº¿é¤J,¦b²M³æ§ä¥X¹ïÀ³ªº¸ê®Æ

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-8-20 07:17 ½s¿è

¦^´_ 2# luhpro
  1. Private Sub CommandButton2_Click()
  2.         With Columns("A:C")
  3.             .ClearContents
  4.             'ClearContents ¤èªk ²M°£½d³òªº¤½¦¡¡C²M°£¹Ïªí¤¤ªº¸ê®Æ¦ý«O¯d®æ¦¡³]©w¡C
  5.             '****²M°£½d³òªº¤½¦¡¤]¥]§t²M°£½d³òªº¦r¦ê***
½Æ»s¥N½X
¸Õ¸Õ¬Ý
  1. 'Sheet1¼Ò²Õªºµ{¦¡½X
  2. Option Explicit
  3. Dim d As Object
  4. Private Sub CommandButton1_Click()
  5.     Dim Text(1 To 2) As String
  6.     Text(1) = Trim(TextBox1)
  7.     Text(2) = Trim(TextBox2)  '¼Ó¥DÀɮצ³¥Î¨ìTextBox2
  8.     UsedRange.ClearFormats    '¨ú¥N  ²M³æCLEAR«ö¶s , CommandButton2
  9.     If Text(1) <> "" And Text(2) <> "" Then
  10.         If d Is Nothing Then item_qty
  11.         If d.EXISTS(Text(1) & Text(2)) Then
  12.             d(Text(1) & Text(2)).Interior.ColorIndex = 44
  13.         End If
  14.     End If
  15. End Sub
  16. Private Sub item_qty()
  17.     Dim r As Range
  18.     Set d = CreateObject("scripting.dictionary") '¦r¨åª«¥ó
  19.     For Each r In UsedRange.Rows
  20.         'item(AÄd)&qty(CÄd)¤º®e¬°¦r¨åª«¥ókey­È,«ü©w¨ì Range
  21.         Set d(r.Cells(1, 1) & r.Cells(1, 3)) = r.Cells(1, 1).Resize(, 3)        
  22.     Next
  23. End Sub
½Æ»s¥N½X
¤£¥Î¨Ï¥Î CommandButton1,
TextBox1,TextBox2 ¦³§ïÅܪ½±µÅã¥Ü
  1. 'Sheet1¼Ò²Õªºµ{¦¡½X
  2. Option Explicit
  3. Dim d As Object
  4. Private Sub TextBox1_Change()
  5.     Ex
  6. End Sub

  7. Private Sub TextBox2_Change()
  8.     Ex
  9. End Sub
  10. Private Sub Ex()
  11.     Dim Text(1 To 2) As String
  12.     Text(1) = Trim(TextBox1)
  13.     Text(2) = Trim(TextBox2)  '¼Ó¥DÀɮצ³¥Î¨ìTextBox2
  14.     UsedRange.ClearFormats    '¨ú¥N  ²M³æCLEAR«ö¶s , CommandButton2
  15.     If Text(1) <> "" And Text(2) <> "" Then
  16.         If d Is Nothing Then item_qty
  17.         If d.EXISTS(Text(1) & Text(2)) Then
  18.             d(Text(1) & Text(2)).Interior.ColorIndex = 44
  19.         End If
  20.     End If
  21. End Sub
  22. Private Sub item_qty()
  23.     Dim r As Range
  24.     Set d = CreateObject("scripting.dictionary") '¦r¨åª«¥ó
  25.     For Each r In UsedRange.Rows
  26.         'item(AÄd)&qty(CÄd)¤º®e¬°¦r¨åª«¥ókey­È,«ü©w¨ì Range
  27.         Set d(r.Cells(1, 1) & r.Cells(1, 3)) = r.Cells(1, 1).Resize(, 3)
  28.         
  29.     Next
  30. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-8-23 10:41 ½s¿è
¥t, Range ªº Copy «ü¥O¨Ï¥Î®É,
­Y¥u¦³«ü©w Destination ¦ÓµL¨ä¥L¯S®í»Ý¨D,
«h Destination:= ¥i¥H¤£¥Î¦C¥X¨Ó,
¥u­n¥´ Cells(2, 8).Copy Cells(3, 8) §Y¥i.
luhpro µoªí©ó 2014/8/23 09:25


¬O¥i¤£«ü©ú²Ä¤@­Ó°Ñ¼Æªº¦WºÙ

expression.Find(What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte, SearchFormat)
¤£«ü©ú»Ý   , , , expression.Find( "TEST", , , , , , ,  ,  TRUE)
«ü©ú¥i¬Ù²¤ , , , expression.Find( "TEST",  SearchFormat:=True)
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¡i¬O§_µo´§¤F¨}¯à¡H¡j¤H¶¡¹Ø©R¦]¬°µu¼È¡A¤~§óÅã±o¬Ã¶Q¡CÃø±o¨Ó¤@½ë¤H¶¡¡AÀ³°Ý¬O§_¬°¤H¶¡µo´§¤F¦Û¤vªº¨}¯à¡A¦Ó¤£­n¤@¨ý¨Dªø¹Ø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD