How to set a range equal to cells greater than 0 (Column "A" only)

  • Thread starter Thread starter Guest
  • Start date Start date
If row 65536 is free (Excel <=2003) -

Columns(1).Insert

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

myrange.Offset(0, -1).FormulaR1C1 = "=IF(RC2>0,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


--
 
Sorry, that should have been 'Column IV', not 'Row 65536'....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top