[xpost][/xpost]
How can I ignore a blank RefEdit when adding ranges? I have the following:
Code
Private Sub CommandButton1_Click()
Dim lRow as Long
lRow = Cells(Rows.Count, "A").End(xlUp).Row
Column1= RefEdit1.Value
Set Rng1= Range(Column1)
Column2= RefEdit2.Value
Set Rng2= Range(Column2) Column3= RefEdit3.Value
Set Rng3= Range(Column3)
Set Total= Range("F2:F" & lRow)
For i = 1 To lRow - 1 Total(i, 1) = Rng1(i, 1) + Rng2(i, 1) + Rng3(i, 1)
Next
End Sub
Display More
This works perfectly if all RefEdits are populated, but nothing happens if one is missing. I can add an "On Error Resume Next", but that doesn't address the problem that no output is shown. How can I say "If Rng1, Rng2, or Rng3 are blank, exclude from calculation"?