发布于 2024-12-10 18:09:08 字数 8 浏览 0 评论 0原文

continue

One worksheet. 103 columns. I need to populate a 104th column that looks in one column (Column O aka. 15). The column only has two values in it, either a 1 or a 3. If that column has a 1 in it then the 104th column cell for that row needs one notation; if it's a 3 then it needs a different notation. I know a little about formulas and a little about vba, which has gotten me nowhere with this. I have other macros that I use to convert values in columns, but they all work within the same column and I can't seem to get those adapted to what I need now. Is there a relatively quick little macro that I can run through that just looks up the value in column o and pops in one of two notations to my last column?

Edited the first part there. Thinking of two things at once I guess. It's columns. There are close to 3600 rows. I need to run through each row and enter a notation in the last column(104th) based off of whether the value in Column O is a 1 or 3. So, start with row 1 and enter either an x or y in the last column depending on the value in column o, then repeat for each row.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅忆流年 2024-12-17 18:09:08

试试这个:

Sub HTH()

    With Range("O1", Cells(Rows.Count, "O").End(xlUp)).Offset(, 89)
        .Formula = "=IF(O1=3,""x"",""y"")"
        .Value = .Value
    End With

End Sub

Try this:

Sub HTH()

    With Range("O1", Cells(Rows.Count, "O").End(xlUp)).Offset(, 89)
        .Formula = "=IF(O1=3,""x"",""y"")"
        .Value = .Value
    End With

End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文