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

¦r¦ê¤¤¬Y´X­Ó¦r¤¸Åܦâ

¦r¦ê¤¤¬Y´X­Ó¦r¤¸Åܦâ

½Ð±Ð¦U¦ì¦p¦ó¥i¥H°µªº¨ì!

§Ú³»¦h¥u¯à°µ¨ìÀx¦s®æÅܦâ


Ä´¦p :

   ¿é¤J AAA
   ²Å¦Xªº¦r¦ê111AAA333
   Åã¥Üªº®É­Ô,§â111AAA333¦r¦ê¤¤ªºAAAÅܦâ

¦^´_ 10# rph
  1.     Private Sub CommandButton1_Click()
  2. Dim A As Range
  3. fc = InputBox("¿é¤J¦r¦ê", , "A") '¿é¤J±ý·j´M¦r¤¸
  4. s = Len(fc) '¿é¤J¦r¦êªº¦r¤¸¼Æ
  5. For Each A In UsedRange '¦b«ö¶s©Ò¦b¤u§@ªíªº¤w¨Ï¥ÎÀx¦s®æ¤¤§@°j°é
  6.    k = InStr(A, fc)  '±ý·j´M¦r¤¸¦bÀx¦s®æ¤¤²Ä´X­Ó¦r¤¸¥X²{
  7.    If k > 0 Then A.Characters(k, s).Font.ColorIndex = 3  'K>0ªí¥Ü¦³³o­Ó¦r¦ê¦s¦b¡A´N±NÀx¦s®æ²Äk¦r¤¸¶}©l¨ús­Ó¦r¤¸ªø«×§ï¬°¬õ¦â¦rÅé
  8. Next
  9. End Sub
½Æ»s¥N½X
§A¥²¶·§ï±¼usedrange¤~¯à¨Ï¥Î¡AÀ³¸Ó¬O§Aªºµ{¦¡¬O¼g¦b¤@¯ë¼Ò²Õ¡A¤£¬O¤u§@ªí¼Ò²Õªº­ì¦]
§ï¦¨ActiveSheet.UsedRange´N·|¥h§â§@¥Î¤¤ªº¤u§@ªí©Ò¦³³Q¨Ï¥ÎÀx¦s®æ°µÀˬd
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ rph ©ó 2011-4-14 11:48 ½s¿è

TO Hsieh
¤µ¤Ñ§Ú¤w±Nª©¥Dªºµ{¦¡½X¶K¨ìEXCEL´ú¸Õ,´ú¸ÕOK(§Ú¦³§â²Ä5¦æªºUSEDRANGE§ï¦¨RANGE("A1:A6"),­n¤£µM·|¦³¿ù»~)
DIM A AS RANGE ´N¬O«Å§iA¬°RANGEª«¥ó  P.S§Ú­è¦³´ú¸Õ,¨S«Å§iµ{¦¡¤@¼Ë¥i¥H¶],¥i§_»¡©ú®t²§??
For Each A In Range("A1:B6") ³o¦æµ{¦¡½X¬O§_¥Nªí±N"A1Àx¦s®æªº­È"©ñ¤J"A",¦A¥h§@§PÂ_,¦A¨Ó´NÅܦ¨"A2Àx¦s®æªº­È"©ñ¤J"A",¥H¦¹Ãþ±À

·PÁÂ!!

TOP

¦^´_ 6# rph
  1. Private Sub CommandButton1_Click()
  2. Dim A As Range
  3. fc = InputBox("¿é¤J¦r¦ê", , "A")
  4. s = Len(fc)
  5. For Each A In UsedRange
  6.    k = InStr(A, fc)
  7.    If k > 0 Then A.Characters(k, s).Font.ColorIndex = 3
  8. Next
  9. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

§Ú­è¤~¤w¥h¤F¸Ñ,¤]¤F¸Ñ¤F[ ] =Application.Evaluate¤èªk,·PÁ±zªº»¡©ú!

TOP

¦^´_ 6# rph
Address ªº¥Îªk¥i¬Ý VBAªº»¡©ú
VBA ¥i¥Î¤u§@ªí¨ç¼Æ»¡©ú´M§ä¦p¹Ï

TOP

1.¥ý¦^À³Hsiehª©¤j
§Úªº¤pµ{¦¡´N¥u»{§Ú¿é¤Jªº¦r¦ê,Ä´¦p¿é¤J"A",¨º¦r¦ê¤¤"123AAA444",´N²Ä1­Ó"A"Åܦâ
¦]¬°§Úªºµ{¦¡¥D­n¥\¯à´N¬O¿é¤JKEY¤§«á,´N§ä¥X²Å¦XKEY¤§¸ê®Æ,¨Ã¥B¦C¥X

2.¦A½Ð±Ð¤@¤UGBKEE,§Ú­è¤~RUN¤F§Aªºµ{¦¡½X,MSGBOX¥X²{$A$1ªºµ´¹ï¦ì§}°T®§,³o¼Ë¬O¥Nªí???

3.¤u§@ªí¨ç¼Æ¦b­þ¥i¬dªº¨ì???§Ú¬ÝEXCELªº¨ç¼Æ¸Ì¦³SEARCH³o­Ó¨ç¼Æ

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-4-13 15:19 ½s¿è

¦^´_ 3# rph
¥[¤W   Application.Search  ªº¨ç¼Æ ¬O¨Ï¥Î¤u§@ªíªº¨ç¼Æ   
¥¿¦¡ªº»yªk¬°  Application.WorksheetFunction.Search
¥i§_»¡©ú¤@¤U³o¥yªº»yªk¤Î¬°¦ó­n¥Î"[]"

[ ] =Application.Evaluate¤èªk
  1. Sub Ex()
  2. MsgBox Application.Evaluate("Sheet1!a1").Address
  3. MsgBox [Sheet1!a1].Address
  4. End Sub
½Æ»s¥N½X

TOP

³o°ÝÃD­n²o¯A¨ì·j´M¦r¦êªº·j´M¼Ò¦¡°ÝÃD
¥H¦¹¨Ò¨Ó»¡¦pªG·j´Mª½«ü¿é¤JA
¨º­n3­ÓA³£ÅܦâÁÙ¬O²Ä¤@­ÓAÅܦâ?
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

³o¬O§Ú¤§«e¼gªºµ{¦¡½X,»yªk¦p¦³¨Ï¥Î¿ù»~,½Ð¦h¥]²[(¦]¬°§Ú¬O¦Û¾Ç)
¶¶«K¦b¦¹·PÁÂyanto913 ªº¨ó§U!!§Ú¦bDEBUG¤¤,¤w¤F¸Ñ§A¼gªº¤è¦¡
¦A½Ð±Ð¤@¤U!!
Application.Search([a1], [b1])¦bEXCEL VBA¥\¯à¯Á¤Þ¦¡°Ñ¦Ò¤â¥U,§Ú§ä¤£¨ì¥Îªk!!
¥i§_»¡©ú¤@¤U³o¥yªº»yªk¤Î¬°¦ó­n¥Î"[]"
Sub «ö¶s4_Click()

   Dim A As String
   
    A = InputBox("¦r  ¦ê", "½Ð ¿é ¤J ¦r ¦ê")
   
    MsgBox A
   
    Cells(1, 5) = A
   
    B = 2
   
    ActiveSheet.Range("I41000").Clear
   
    Do Until InStr(1, Cells(B, 2).Value, A, 1)
     
        B = B + 1
      
       If B >= 100 Then
      
       MsgBox "±z¿é¤Jªº©m¦W¬O¡G   " & A, vbOKOnly + vbCritical, Title:="¬dµL¦¹¦r¦ê"
      
       A = InputBox("½Ð­«·s¿é¤J¦r¦ê")
      
       B = 2
      
       End If
      
     Loop
   
    X = 4
   
    For B = 2 To 100
     
      If InStr(1, Cells(B, 2).Value, A, 1) Then
      
            
         Cells(X, 9) = Cells(B, 1)
         
         Cells(X, 10) = Cells(B, 2)
         
         Cells(X, 11) = Cells(B, 3)
         
         Cells(X, 12) = Cells(B, 4)
         
         XX = Len(Cells(1, 5).Value)

         yy = Application.Search(Cells(1, 5).Value, Cells(X, 10).Value)

         Cells(X, 10).Select

         With ActiveCell.Characters(Start:=yy, Length:=XX).Font
         
           .Bold = True
           
           .ColorIndex = 3

         End With
                              
         X = X + 1
         
      End If
      
    Next
   
End Sub

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¤£¤@©w²y²y¬O¦n²y¡A¦ý¬O¦³¾ú½mªº±j¥´ªÌ¡AÀH®É³£¥i¥H´§´Î¡C
ªð¦^¦Cªí ¤W¤@¥DÃD