Obramuj każdą komórkę w zakresie
Próbuję stworzyć prostą funkcję, która doda obramowanie do każdej komórki w pewnym zakresie. Użycie wspaniałego nagrania generuje mnóstwo kodu, który jest zupełnie bezużyteczny. Poniższy kod wyświetli „tabelę” danych, wokół każdej komórki w tym zakresie chciałbym dodać obramowanie. Online Nie udało mi się znaleźć prostej lub jasnej odpowiedzi na to pytanie.
Cała pomoc jest bardzo ceniona!
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