ExcelVBA判断区域中是否有值并输入数据

2022-10-25 13:20:05 浏览数 (2)

Sub tfff() ActiveSheet.UsedRange.Interior.ColorIndex = xlNone Rng = Range("a1") Range(Rng).Interior.ColorIndex = 2 Range(Rng).Borders.LineStyle = xlContinuous i = 1 For Each r In Range(Rng) If r.Value = "" Then r.Value = i i = i 1 End If Next End Sub

0 人点赞