ajoy123rocks
New Member
- Joined
- Jul 13, 2022
- Messages
- 9
- Office Version
- 2019
- Platform
- Windows
I am unable to copy the entire cell including all borders and paste it onto the adjacent cell.
The original sheet is shown in 1.jpg
I want to delete P1 from row 18. When this is done U2 will remove to column G along with its border formatting. But I see a blue bottom border in Column G as shown in 2.jpg
The expected result is shown in 3.jpg
Kindly please help..
The original sheet is shown in 1.jpg
I want to delete P1 from row 18. When this is done U2 will remove to column G along with its border formatting. But I see a blue bottom border in Column G as shown in 2.jpg
The expected result is shown in 3.jpg
Kindly please help..
VBA Code:
For col_num = col_num To 12
'MsgBox stored_row & col_num
If col_num = 12 Then
Exit For
End If
If Sheets("DSS").Cells(stored_row, col_num + 1).Value <> "" Then
Sheets("DSS").Cells(stored_row, col_num + 1).Copy
Sheets("DSS").Cells(stored_row, col_num).PasteSpecial
Application.CutCopyMode = False
Sheets("DSS").Cells(stored_row, col_num + 1).Value = ""
ElseIf Sheets("DSS").Cells(stored_row, col_num + 1).Value = "" Then
Sheets("DSS").Cells(stored_row, col_num + 1).Copy
Sheets("DSS").Cells(stored_row, col_num).PasteSpecial
Application.CutCopyMode = False
'Exit For
End If
If Sheets("DSS").Cells(stored_row - 1, col_num).Value <> "" Then
Cells(stored_row, col_num).Select
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Color = vbBlue
.TintAndShade = 0
.Weight = xlThick
End With
End If
If Sheets("DSS").Cells(stored_row + 1, col_num).Value <> "" Then
Cells(stored_row, col_num).Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Color = vbBlue
.TintAndShade = 0
.Weight = xlThick
End With
End If
Next