作者:要做转播达人 | 来源:互联网 | 2023-08-29 12:43
New to excel VBA. I know the following is incorrect as "x" & i
will give a string, not a variable. But suppose I have 100 xs and I want to populate into cells. I do not want to put all x values in an array and later call from the array. Is there a quick and easy way to fix the following?
擅长VBA的新手。我知道以下是不正确的“x”&我将给出一个字符串,而不是一个变量。但假设我有100 xs,我想填入细胞。我不想将所有x值都放在一个数组中,然后再从数组中调用。有没有快速简便的方法来解决以下问题?
Sub test()
x1 = 1
x2 = 2
x3 = 3
For i = 1 To 3
Cells(i, 1) = "x" & i
Next
End Sub
1 个解决方案