View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
michdenis michdenis is offline
external usenet poster
 
Posts: 135
Default copy rows in range if data in first cell

If you want Text and numerical stemming from formula

'-------------------------------
Sub test()
Dim Rg As Range

On Error Resume Next
With Sheet1
With .Range("A1:A" & .Range("A65536").End(xlUp).Row)
Set Rg = .SpecialCells(xlCellTypeFormulas, 3)
End With
End With
Rg.EntireRow.Copy Sheet2.Range("A1")

End Sub
'-------------------------------


"michdenis" a écrit dans le message de groupe de discussion :
...
Hi,

For cells containing Text only

'---------------------------
Sub test()
Dim Rg As Range

On Error Resume Next
With Sheet1
With .Range("A1:A" & .Range("A65536").End(xlUp).Row)
Set Rg = .SpecialCells(xlCellTypeFormulas, xlTextValues)
End With
End With
Rg.EntireRow.Copy Sheet2.Range("A1")

End Sub
'---------------------------



"Wes_A" a écrit dans le message de groupe de discussion :
...
I need to select from a range of rows - only those having data (formula
result) in the first cell. There will be some rows without data in the first
cell but they would contain a formula - these shoudl not be selected for copy.
I want to select and copy all the rows having data in the first cell in
order to paste these rows as values into a separate sheet in another workbook.
Any suggestion?