for each cell

  • Thread starter Thread starter Jak
  • Start date Start date
J

Jak

As you know excel does not paste as value when the cells
are selected with the control button in different parts of
the sheet. What I would like to do is to write a macro so
that
For each cell in selection
do the paste special for each cell
next cell

Can anyone help me with the systax of the above. I just
wrote what I needed excel to do.

Thanks
 
Jak
try
Sub Macro4()
Dim cell As Range
For Each cell In Selection
cell.Copy
cell.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next
End Sub

Cecil
 
But it does work if you do it area by area:

Option Explicit
Sub testme()

Dim myArea As Range

For Each myArea In Selection.Areas
With myArea
.Value = .Value
End With
Next myArea

End Sub
 
Back
Top