我想创建一个简单的功能,将在一定范围内的每个单元格周围添加边框。使用精彩的录音会产生大量无用的代码。下面的代码将显示一个“表格”的数据,在这个范围内的每个单元格周围,我想添加一个边框。在线我一直无法找到一个简单或明确的答案。在一个范围内的每个单元格周围的边框
所有帮助非常感谢!
Set DT = Sheets("DATA")
endRow = DT.Range("F" & Rows.Count).End(xlUp).Row
result = 3
For I = 2 To endRow
If DT.Cells(I, 6).Value = Range("B1").Value Then
Range("A" & result) = DT.Cells(I, 6).Value
Range("B" & result) = DT.Cells(I, 1).Value
Range("C" & result) = DT.Cells(I, 24).Value
Range("D" & result) = DT.Cells(I, 37).Value
Range("E" & result) = DT.Cells(I, 3).Value
Range("F" & result) = DT.Cells(I, 15).Value
Range("G" & result) = DT.Cells(I, 12).Value
Range("H" & result) = DT.Cells(I, 40).Value
Range("I" & result) = DT.Cells(I, 23).Value
result = result + 1
End If
Next I
我编辑我的头衔视为尽管它迷惑人。 – CustomX