Excel 仅将公式应用于一列的宏

Excel Macro that will simply apply a formula to one column

我对 VBA 语法一无所知,我需要创建一个 Excel 宏,它将简单地将公式应用于 A 列中所有填充的单元格。(公式为 =concatenate(B1 ,C1,D1) 相对于单元格)

我已经搜索了这个问题的答案,虽然有很多类似的问题,但它们都非常具体,我无法操纵给出的代码来执行此操作。感谢您的帮助。

这是我使用 Do While 循环编写的一些代码,用于连接三个单独的列,您可以对任意数量的列执行相同的操作,只需进行最少的调整。

它将从每个指定列中的信息横向连接同一行的单元格,并循环直到完成每一行。

Dim noSep As String
noSep = ""

Cells(1, 2) = columnOne
Cells(1, 6) = columnTwo
Cells(1, 8) = columnThree
Cells(1, 47) = concatResult

x = 2
Do While Cells(x, columnOne) <> ""
Cells(x, concatResult) = Cells(x, columnOne) & noSep & Cells(x, columnTwo) & noSep & Cells(x, columnThree)
x = x + 1
Loop