在“Do While”循环中将字符串复制到浮点数上 [英] Copying strings over floats in 'Do While' loop

查看:143
本文介绍了在“Do While”循环中将字符串复制到浮点数上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个宏,它将在下一个单元格中的一个float / integer上复制一个字符串,直到它碰到另一个字符串。我发现一些代码,我认为会工作,并希望帮助修改它(或者如果我应该在不同的方向,告诉我):

I'm attempting to create a macro that copies a string over a float/integer in the next few cells until it hits another string. I've found some code that I thought would work and would like help modifying it (or if I should go in a different direction, tell me):

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)。

I need to copy each string over the following floats/integers, until the next string. Then repeat until the end of the column (column A).

http://www.flickr.com/photos/hillsindustries/12198631954/

推荐答案

选择范围,首页>编辑>查找&选择,转到特殊...,常数,数字(仅),确定, Del = ,向上, Ctrl + 输入

Select range, Home > Editing > Find & Select, Go To Special…, Constants, Numbers (only), OK, Del, =,Up, Ctrl+Enter.

这篇关于在“Do While”循环中将字符串复制到浮点数上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆