add a border to bottom of a row

bdt

Board Regular
Joined
Oct 3, 2024
Messages
53
Office Version
  1. 2019
Platform
  1. Windows
Hi again guys,
Im hoping to be able to add a border to a row that has been added to worksheet "OVERTIME".
I've found this code, but know idea how to apply it to a row;
Range("A1") _ .Borders(xlEdgeBottom) _ .LineStyle = XlLineStyle.xlContinuous

The code I wish to add this to is;
'copy overtime saturday
With Sheets("ABACUS")
WKend = .Range("DE2").Value2
arr = .Range("AU21:AU32").Value
End With

With Sheets("OVERTIME")
' last used row in column B plus 1
writerow = .Range("B" & .Rows.Count).End(xlUp).Row + 1
.Range("A" & writerow) = WKend
.Range("B" & writerow).Resize(, UBound(arr)).Value = Application.Transpose(arr)
End With

Many thanks once again
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Try...
Rich (BB code):
  'copy overtime saturday
    With Sheets("ABACUS")
        WKend = .Range("DE2").Value2
        arr = .Range("AU21:AU32").Value
    End With

    With Sheets("OVERTIME")
        ' last used row in column B plus 1
        writerow = .Range("B" & .Rows.Count).End(xlUp).Row + 1
        .Range("A" & writerow) = WKend
        With .Range("B" & writerow).Resize(, UBound(arr))
            .Value = Application.Transpose(arr)
            .Borders(xlEdgeBottom).LineStyle = xlContinuous
        End With
    End With
 
Upvote 0
Solution
Mark858, thanks for your reply, this works as asked. But now realize I require the bottom border to cover columns A to X of said row.
Cheers
 
Upvote 0
like this
VBA Code:
With Sheets("OVERTIME")
    ' last used row in column B plus 1
    writerow = .Range("B" & .Rows.Count).End(xlUp).Row + 1
    .Range("A" & writerow) = WKend
    .Range("B" & writerow).Resize(, UBound(arr)).Value = Application.Transpose(arr)
    .Range("A" & writerow & ":X" & writerow).Borders(xlEdgeBottom).LineStyle = xlContinuous
End With
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,106
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top