P
Prohock
I would like to move a cells value and font as well ... but with no other
cell formating. I have the following code that works perfectly with the cells
value, except that the cells that are moved take on the cell format of the
cells that the original content is being moved to.
Dim vTemp As Variant
With Selection
If .Count <> 2 Then
MsgBox "2 courses only."
Else
If .Areas.Count = 2 Then
vTemp = .Areas(1).Cells.Value
.Areas(1).Cells.Value = .Areas(2).Cells.Value
.Areas(2).Cells.Value = vTemp
vTemp = .Areas(1).Offset(1, 0).Cells.Value
.Areas(1).Offset(1, 0).Cells.Value = .Areas(2).Offset(1,
0).Cells.Value
.Areas(2).Offset(1, 0).Cells.Value = vTemp
Else
vTemp = .Cells(1).Value
.Cells(1).Value = .Cells(2).Value
.Cells(2).Value = vTemp
End If
End If
End With
End Sub
cell formating. I have the following code that works perfectly with the cells
value, except that the cells that are moved take on the cell format of the
cells that the original content is being moved to.
Dim vTemp As Variant
With Selection
If .Count <> 2 Then
MsgBox "2 courses only."
Else
If .Areas.Count = 2 Then
vTemp = .Areas(1).Cells.Value
.Areas(1).Cells.Value = .Areas(2).Cells.Value
.Areas(2).Cells.Value = vTemp
vTemp = .Areas(1).Offset(1, 0).Cells.Value
.Areas(1).Offset(1, 0).Cells.Value = .Areas(2).Offset(1,
0).Cells.Value
.Areas(2).Offset(1, 0).Cells.Value = vTemp
Else
vTemp = .Cells(1).Value
.Cells(1).Value = .Cells(2).Value
.Cells(2).Value = vTemp
End If
End If
End With
End Sub