【求助】用宏来批量筛选并下移excel单元格
程序代码:
Sub 按钮1_Click() Dim rng As Range Dim b As Integer b = 0 Dim what As String Dim a As String what = "C" 'a = CStr(rng.Rows) 'b = CStr(rng.Column) Do 'Set rng = ActiveSheet.UsedRange.Find(what, after:=Cells(1, 1)) Set rng = ActiveSheet.UsedRange.Find(what, after:=Cells(1, 1)) If b = 429 Then Exit Do Else a = Chr(rng.Column + 64) + CStr(rng.Row + 2) MsgBox a rng.Cut Range(a) '把内容剪切到另一单元格 ' MsgBox rng.Column b = b + 1 End If Loop End Sub
需求是把文档里每一个“C”下移两行,现在做到的只是移动最近的C,可能要再加一个参数来改变起始位置?
小弟没接触过vb,边查边学,奈何没有完整教程,对类型和函数都不了解,还望高手解惑。