首页 文章

Excel宏向单元格添加值

提问于
浏览
0

我想请求有关Excel宏的一些帮助 .

我有一个充满数据的列,我想创建一个宏,当我运行它时,它为该列中的每个单元格添加“1”,而不是必须在所有300个单元格中键入“1” . 有什么建议?谢谢您的帮助 .

1 回答

  • 4

    place a "1" 在单元格中:

    Sub Place1()
        Range("A1:A300").Value = 1
    End Sub
    

    add "1" to the current value 在单元格中:

    Sub Add1()
        For Each r In Range("A1:A300")
            r.Value = r.Value + 1
        Next r
    End Sub
    

相关问题