如何使用复制3个非相邻的单元格ActiveCell.Row?
Range("A" & ActiveCell.Row, "C" & ActiveCell.Row, "E" & ActiveCell.Row).Copy
Run Code Online (Sandbox Code Playgroud) 我有一个情况,我需要clear变量,lastWord以便msgbox下一步显示任何内容loop.
下面的代码只是一个例子.
Sub clear_lastWord_Variable()
Dim wordArr() As String
Dim lastword As String
Do
selection.Find.ClearFormatting
selection.Find.Font.Bold = True
With selection.Find
.Forward = True
.Wrap = wdFindStop
End With
selection.Find.Execute
If selection.Find.Found Then
wordArr = Split(selection, " ")
For i = LBound(wordArr) To UBound(wordArr) Step 1
lastword = wordArr(i)
Next i
MsgBox lastword
' here should be something to clear lastword
Else
Exit Do
End If
Loop
End Sub
Run Code Online (Sandbox Code Playgroud)