我需要在名为“data”的工作表上找到值“windows_group”的多个随机定位实例,并将单元格的值返回到“windows_group”单元格到另一个工作表“Windows_Groups”。excel - 在左边单元格中找到ramdomly的值和返回值
工作表“数据”只有列A-G中的数据,但最多可以有5000行。
预先感谢您!
我需要在名为“data”的工作表上找到值“windows_group”的多个随机定位实例,并将单元格的值返回到“windows_group”单元格到另一个工作表“Windows_Groups”。excel - 在左边单元格中找到ramdomly的值和返回值
工作表“数据”只有列A-G中的数据,但最多可以有5000行。
预先感谢您!
有可能是一个更优美做到这一点,但蛮力的方法是通过你的细胞回路,并使用偏移方法的宏:
sub FindAndReturn() 'I'm not good at naming
dim cell as range
dim i as integer
dim k as integer
k = 1
for each cell in Worksheets("Data").Range("B1:G5000") ' i'm assuming this has to start in column B if you want the value to the left
if cell.value = "windows_group" Then
Worksheets("Windows_Groups").Range("A" & k).Value = cell.offset(0,-1).value
k=k+1
End if
next cell
end sub
“的问题,要求辅导家庭作业,必须包括总结你迄今为止解决问题所做的工作,以及你解决问题的难点描述。“要求人们做你的功课,你甚至还没有开始是在Stackoverflow不禁忌。请参见[如何创建最小,完整和可验证示例](http://stackoverflow.com/help/mcve)。 – MikeJRamsey56