View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JD JD is offline
external usenet poster
 
Posts: 7
Default Copy non blank cells to another worksheet

HI, can anyone point out why this isn't working?

Sub CopyDataOnly()

Sheets("Sheet1").Range("A10:A100").Select
Selection.SpecialCells(xlCellTypeConstants, 23).Select
Selection.Copy
Sheets("Sheet2").Select
Range("A10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

End Sub

I end up getting an error after "Selection.Copy".

Basically I'm looking to select all cells with data and move them to
another worksheet and paste them.