宏函数
function test(){
let startrow = 1
let endrow = 6
for(let i = startrow;i<=endrow;i++){
ActiveSheet.Range(`A${i}:E${i}`).Interior.ThemeColor = -4142
let arr = ActiveSheet.Range(`A${i}:E${i}`).Value2.flat()
let a = Application.WorksheetFunction.Min(arr)
let b = 0
let col = -1
while(a!=b){
col = Math.floor(Math.random()*arr.length)
b=arr[col]
}
ActiveSheet.Cells.Item(i,col+1).Interior.ThemeColor = 5
}
}
WPS寻令官
KVP函数专家、创作者俱乐部成员
创作者俱乐部成员
WPS寻令官 | WPS产品体验官
创作者俱乐部成员