Cyril Beki
Board Regular
- Joined
- Sep 18, 2021
- Messages
- 57
- Office Version
- 2016
- Platform
- Windows
Hello Expert,
I've read previous post regarding border (Automatically put borders around my data using VBA),
And i used code provided by Rick Rothsein to try to solve my issue in my Userform VBA but the code will not add the border to the new data automatiacally once data is filled.
Which part of code should be changed in order to make the border automatically filled in as soon as data is added ?
My data Column is starting from A8 to Q8. I want the border to be automatically filled as soon as data is added. Thank you in advance. Can anyone help me. Code is below
I've read previous post regarding border (Automatically put borders around my data using VBA),
And i used code provided by Rick Rothsein to try to solve my issue in my Userform VBA but the code will not add the border to the new data automatiacally once data is filled.
Which part of code should be changed in order to make the border automatically filled in as soon as data is added ?
My data Column is starting from A8 to Q8. I want the border to be automatically filled as soon as data is added. Thank you in advance. Can anyone help me. Code is below
VBA Code:
Dim LastRow As Long, LastCol As Long
Cells.Borders.LineStyle = xlNone
LastRow = Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row
LastCol = Cells.Find("*", , xlValues, , xlByColumns, xlPrevious).Column
With Range("A8", Cells(LastRow, LastCol))
.BorderAround xlDouble
.Rows.Borders(xlInsideHorizontal).LineStyle = xlDash
.Rows.Borders(xlInsideVertical).LineStyle = xlContinuous
.Columns.AutoFit
End With