开发者

Updating column values on specific Row using VBA

开发者 https://www.devze.com 2023-04-12 00:04 出处:网络
How to update value from xt to xtt in 6th column, first row开发者_StackOverflow社区. 123456 xxxxyxzx1 xt

How to update value from xt to xtt in 6th column, first row开发者_StackOverflow社区.

1    2    3   4    5  6

x    xx  xy   xz   x1 xt

y    yx  tt   cc  z3  xcc

Based on above data, I am getting range from worksheet. After getting the Row object, how do I update the Cell value in particular column?


As asked, you can update a specific column using the method:

'Sheet.Cells(row, column) = value
' i.e.
ActiveSheet.Cells(1, 6) = "xtt"

If you only want to perform the update if it has a value of "xt", then obviously you'd need to check the contents before performing the update... For example:

If (ActiveSheet.Cells(1, 6) = "xt") Then
    ActiveSheet.Cells(1, 6) = "xtt"
End If
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号