Formula based on another cell value
OK, here's what I came up with:
Range("F2:F" & RNGEND).Select
Dim LVLRNG As Range
For Each LVLRNG In Selection.Cells
If ActiveCell.Offset(0, -3).Value = "A" Then
LVLRNG.Value = "Appt"
ElseIf ActiveCell.Offset(0, -3).Value = "W" Then
LVLRNG.Value = "Walk-In"
End If
Next LVLRNG
However, when it loops through, it makes all of them "APPT" even
though there are "W"'s in the column that's three rows over.
FYI, I'm just making sure it works, once it does, than the
lvlrng.value will equal the formula that I want.
Brendon
Fester wrote:
I want to run a loop that looks at a value in one cell, and then
enters one formula for one value, and another for a different value.
So if Cell B2="X" then
* range("E2").value = "formula"
elseif Cell B2 = "Y" then
* range("E2").value = "other formula
this would loop through all cells until it found an empty cell.
Any help is appreciated.
Brendon
--
Dave Peterson
|