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

[µo°Ý] ¦hÀɮרú¥N®æ¦¡vba

[µo°Ý] ¦hÀɮרú¥N®æ¦¡vba

¦]¤u§@»Ý­n¦h±i¤u§@ªí¤@¦¸¨ú¥N¡A¬G¨D¸Ñ¥H¤Uvba¼gªk¡A¦ý¸m´«¨ä¤¤¤@Ä欰06-2013¡A¸m´«¦¨07-2013¡A¦ýÂà´««h¤@ª½¶]¨ì¤é´Á®æ¦¡¡G2013/7/1¡A
¹ê»Ú¥H¨ú¥N¥\¯à§@·~«h¤£·|¡A¯à§_½Ð±Ð¥H¤Uvba¼gªk»Ý¥[¤J¤°»ò°Ñ¼Æ¡A¤~¯àÅý®æ¦¡¤£·|¶]±¼¡C

Sub Macro1()

    Dim nowworkbook As String   '³]©wªºÀɮצWºÙ
    Dim s As String  '³Q¨ú¥Nªº¦r¦ê
    Dim d As String  '¨ú¥N¹Lªº¦r¦ê
    Dim strFileName As String   'Ū¨úªºÀɮצWºÙ
   
    nowworkbook = Excel.ActiveWorkbook.Name

    n = 2
   
    strFileName = Cells(n, 1)
    While strFileName <> ""
        Workbooks.Open Filename:=Excel.ActiveWorkbook.Path & "\" & strFileName
        
        
        For j = 1 To Sheets.Count
        
            Sheets(j).Select
            
            i = 2
        
            
            While Windows(nowworkbook).ActiveSheet.Cells(i, 2) <> ""
                s = Windows(nowworkbook).ActiveSheet.Cells(i, 2)
                d = Windows(nowworkbook).ActiveSheet.Cells(i, 3)
                    
                Cells.Replace What:=s, Replacement:=d
                i = i + 1
            Wend
            Cells(1, 1).Select
        Next
        
        n = n + 1
        
        strFileName = Sheet1.Cells(n, 1)
    Wend
    End Sub

¦^´_ 1# paddyliu
¥[¤U
Format(2013/7/1, "mm-yyyy")

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2013-10-13 21:39 ½s¿è

¦^´_ 1# paddyliu
¦pªG½T©w±ý¨ú¥Nªº¦r¦ê³£¬O¦bÀx¦s®æªº¶}ÀYªº¸Ü,
¥i¦Ò¼{§ï¦¨©³¤U³o¼Ë¸Õ¸Õ : (¦b³Ì«e­±¥[­Ó ' ±j¨îÂন¤å¦r¼Ò¦¡)

Cells.Replace What:="06-2013", Replacement:="'07-2013"

·íµM, ­Y¬O¦r¦ê¥i¯à¥X²{¦b¤¤¶¡©Î§ÀºÝ¨º´N¤£¾A¥Î¤F.

TOP

        ÀR«ä¦Û¦b : ¤Ñ¤W³Ì¬ü¬O¬P¬P¡A¤H¥Í³Ì¬ü¬O·Å±¡¡C
ªð¦^¦Cªí ¤W¤@¥DÃD