View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Roger Whitehead[_2_] Roger Whitehead[_2_] is offline
external usenet poster
 
Posts: 28
Default How to set a range equal to cells greater than 0 (Column "A" only)

If row 65536 is free (Excel <=2003) -

Columns(1).Insert

Set myrange = Columns("B").SpecialCells(xlCellTypeConstants, xlNumbers)

myrange.Offset(0, -1).FormulaR1C1 = "=IF(RC20,1,"""")"
With myrange.Offset(0, -1)
.Value = .Value
End With

'Watch for the word wrap on next line-
Set myrange = myrange.Offset(0, -1).SpecialCells(xlCellTypeConstants,
xlNumbers).Offset(0, 1)
Columns(1).Delete

Debug.Print myrange.Address


--
---
HTH
Roger
Shaftesbury (UK)
(Excel 2003, Win XP/SP2)



"Alex St-Pierre" wrote in message
...
Thank you!
Aex
--
Alex St-Pierre