我正在尝试创建一个宏,该宏在接下来的几个单元格中将一个字符串复制到float / integer上,直到命中另一个字符串为止。我找到了一些我认为会起作用的代码,并希望对其进行修改(或者,如果我应该朝另一个方向发展,请告诉我):
Sub ReplaceNumberswithText()
' Performs Do loop, testing at top of loop.
' Loops until empty cell is reached.
' Note that you can also use a Do While Not IsEmpty(ActiveCell) loop.
' Test contents of active cell; if active cell is empty, exit loop.
Do Until IsEmpty(ActiveCell)
If ActiveCell.Text Then Text.Copy
End If
' Copies cell contents.
' Step down 1 row to the next cell.
ActiveCell.Offset(1, 0).Select
Selection.Paste
Else: If ActiveCell.Value = 0 Then ActiveCell.Offset(1, 0).Select
End If
' Return to top of loop.
Loop
End Sub
我需要在以下浮点数/整数之间复制每个字符串,直到下一个字符串为止。然后重复直到该列的末尾(A列)。
选择范围,首页>编辑>查找和选择,转到特殊......,常量,数字(只),OK, ,Del,=
向上,Ctrl+ Enter。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句