Hello,
I have a table dependent on another table that users will input information. I am trying to make my table dynamic, meaning that I want the border to move up and down with the displayed values when it is updated by a command button.
For example, from my picture I would like the border to be around the range of B23 to H(newRow). I do not want a border inside of that dynamic range. Any suggestions on how one might do that? Thank you.
I have a table dependent on another table that users will input information. I am trying to make my table dynamic, meaning that I want the border to move up and down with the displayed values when it is updated by a command button.
For example, from my picture I would like the border to be around the range of B23 to H(newRow). I do not want a border inside of that dynamic range. Any suggestions on how one might do that? Thank you.
VBA Code:
Private Sub UpdateButton_Click()
'newRow = ActiveSheet.Cells(1000, 3).End(xlUp).Row 'Goes to the last updated cell
'ActiveSheet.Cells(newRow, 3).Select
Dim lRow As Long, newRow As Long
lRow = ActiveSheet.Cells(Rows.Count, 3).End(xlUp).Row
For newRow = lRow To 1 Step -1
If ActiveSheet.Cells(newRow, 3) <> 0 Then Exit For
Next
ActiveSheet.Cells(newRow, 3).Select
ActiveSheet.Range("B" & newRow).Resize(, 8).Borders(xlEdgeBottom).Weight = xlThin 'Creates bottom border
'ActiveSheet.Range(Cells(24,2),Cells(newRow,8).BorderAround , xlThin
'I want to create a border on the left,right and bottom of a range from B24 to H"newRow"
End Sub