Cell borders lost with cut

  • Thread starter Thread starter Brinton Ramoly
  • Start date Start date
B

Brinton Ramoly

We have developed a time sheet in Excel 2002 (Windows XP)
and used heavy borders around time input cells. When users
move entered time values using cut, rather than copy, the
borders are removed. Is there a way to maintain the cell
borders when using cut? Thanks
 
Brinton Ramoly said:
We have developed a time sheet in Excel 2002 (Windows XP)
and used heavy borders around time input cells. When users
move entered time values using cut, rather than copy, the
borders are removed. Is there a way to maintain the cell
borders when using cut? Thanks

If you Copy, rather than Cut, then Paste Special becomes an option.
Paste Special > Values will not overwrite formatting.
 
Is there a way to maintain the cell borders when using cut?

No there isn't. This is possibly the biggest hassle Excel developers face.
You have to disable cutting (and drag and drop) and that can only be done
with macros. If you're using macros the routines below may help you. You'd
run them when your app opens and closes.

--
Jim Rech
Excel MVP

Sub DisableCuts()
Dim oCtls As CommandBarControls, oCtl As CommandBarControl
Set oCtls = CommandBars.FindControls(ID:=21) ''Cut
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = False
Next
End If
Set oCtls = CommandBars.FindControls(ID:=522) ''Options
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = False
Next
End If
With Application
.OnKey "^x", ""
.OnKey "+{Del}", ""
.CellDragAndDrop = False
End With
End Sub

Sub EnableCuts()
Dim oCtls As CommandBarControls, oCtl As CommandBarControl
Set oCtls = CommandBars.FindControls(ID:=21)
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = True
Next
End If
Set oCtls = CommandBars.FindControls(ID:=522)
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = True
Next
End If
With Application
.OnKey "^x"
.OnKey "+{Del}"
.CellDragAndDrop = True
End With
End Sub
 
Thanks
-----Original Message-----


If you Copy, rather than Cut, then Paste Special becomes an option.
Paste Special > Values will not overwrite formatting.


.
 
Back
Top