PDA

View Full Version : Clean trim code explanation



kire001
06-28-2018, 04:14 AM
Hi there,
I have the following code from the web for clean trim range. I just don't understand why is there a condition using ROW ( "IF(ROW(") and how it works. Appreciate any help. Thanks!

r.Value = Evaluate("IF(ROW(" & r.Address & "),PROPER(TRIM(CLEAN(" & r.Address & "))))")

Aflatoon
06-28-2018, 05:18 AM
The IF(ROW()) part is there to force the result to be an array of values. (You could also use INDEX()) Without it, you'd just get one value back.