当前位置: 代码迷 >> VBA >> Excel轮换用VBA
  详细解决方案

Excel轮换用VBA

热度:505   发布时间:2013-02-26 00:00:00.0
Excel替换用VBA
Sub Replace(ByVal oldDate As Date, ByVal newDate As Date)      Dim lngYLine As Long    Dim intXLine As Integer    Dim objFind As Object    Dim strAddress As String     Set objFind = Cells.Find(oldDate)    If Not objFind Is Nothing Then        strAddress = objFind.Address        Do While Not objFind Is Nothing            lngYLine = objFind.Cells.Row            intXLine = objFind.Cells.Column            Cells(lngYLine, intXLine).Value = newDate                        Set objFind = Cells.FindNext(objFind)            If objFind Is Nothing Then                Exit Do            End If        Loop    Else        MsgBox CStr(oldDate) + "  見つかりませんでした"    End IfEnd Sub

?

  相关解决方案