> Mon Apr 26 2021 14:57:41 GMT+0800 (GMT+08:00) ![](https://img.kancloud.cn/b9/71/b971b377bfdbf8cde51a0979ef8aa3a2_789x400.png) ```js function resultRange(fontColor, colorIndex) { Range("B2").Font.Color = fontColor//49407 Range("B2").Interior.ColorIndex = colorIndex//1 } function turntable() { resultRange(-4142, -4142) Range("B2").Value2 = "" let tableItems = [ "A1", "B1", "C1", "D1", "D2", "D3", "D4", "C4", "B4", "A4", "A3", "A2" ]; // 随机圈数 let counts = WorksheetFunction.RandBetween(0, 2) // 随机中奖者 let lg = WorksheetFunction.RandBetween(0, tableItems.length - 1) let secondTimes = () => { return WorksheetFunction.RandBetween(1, 5) } for (let i = 0; i <= counts; i++) { let lastC if (i == counts) { lastC = lg } else { lastC = tableItems.length - 1 // } for (let x = 0; x <= lastC; x++) { let rngName = tableItems[x] let trange = Range(rngName) let trange_color = trange.Interior.ColorIndex trange.Interior.ColorIndex = 3 trange.Select() let now = new Date() let seconds = now.getTime() now.setTime(seconds + 300) Application.Wait(now.toLocaleString()) trange.Interior.ColorIndex = trange_color if (x == lastC && i == counts) { let p = resultRange(49407, 1) let winner = tableItems[lg];//中奖单元格 Range("B2").Formula = "=" + winner } } } } ``` > 看着改吧,糟糕极了。