Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello all,
I've been looking through the Help files for this and this is what they have listed: Sub RoundToZero2() For Each c In Worksheets("Sheet1").Range("A1:D10").Cells If Abs(c.Value) < 0.01 Then c.Value = 0 Next End Sub The range I want to use in this loop is already selected (after pasting, the pasted data is selected). So I tried changing "Worksheets("Sheet1").Range("A1:D10").Cells" to "ActiveWindow.RangeSelection.Cells". No workie... The other thing I'm concerned about is the "For Each c": Does "c" need to be set to an object variable (like a "Cell" or "Cells" object or something like that), or will Excel/VBA automatically know that "c" means each cell in the range. thanks for any help anyone can provide, Conan Kelly |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Looping thru a range of cells | New Users to Excel | |||
Looping thru values in a Range of Cells | Excel Programming | |||
Looping through a range of cells | Excel Programming | |||
Looping thru cells in a named range | Excel Programming | |||
looping cells though a named range | Excel Programming |