我无法复制整个单元格(包括所有边框)并将其粘贴到相邻单元格。原始工作表显示在1.jpg中。我想删除第18行中的P1。完成后,U2将连同其边框格式一起删除到G列。但我在G列中看到蓝色的下边框,如2.jpg所示。预期结果显示在3.jpg中
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
我无法复制整个单元格(包括所有边框)并将其粘贴到相邻单元格上。
原始工作表显示在1.jpg中,我想从第18行删除P1。完成后,U2将连同其边框格式沿着移到G列。
但是我在G列中看到了蓝色的下边框,如2.jpg所示
预期结果如3.jpg所示
1条答案
按热度按时间hzbexzde1#
这可能会给予你一个方法来做你想要的: