Hi rberke,
Blanks are in fact <no value> while an empty string ("") is a value. Programmatically, with strings in vb, this is differentiated in two ways: vbNullString (no value) and vbEmptyString("").
Now functions (most of them i guess) don't return a no-value but an 'empty' value. Example with the Trim function: whether it is a no-value or a empty value, it returns a empty value. Same with right(), left(), ...
Qu1 - Replacing blanks (no-value) with empty value (""):
-Outside the data, in a cell, enter ="". Then Copy/PasteSpecial As Value over the same cell.
-Copy that cell
-Select the data (selection does NOT contains the above cell)
-menu Edit > Goto, button Special, select Blanks, click OK. All blanks are now selected
-do a Paste
All blanks are now empty.
Qu2 - telling Excel to automatically delete trailing blanks from every data entry, import, or cut and paste?
Automatically, no. i don't think so.
But you can do it using the Edit > Replace. for Find, enter a space. Enter nothing for the Replace. Click ReplaceAll.
Qu3 - ISBLANK is 100% equivalent to vba function ISEMPTY
quickly, i would say yes... maybe some situations that don't apply, not sure, i would have to think more about the definitions.
Online Help says "IsEmpty...indicates whether a variable has been initialized."
"misnamed it"... i agree with you :-) ...(see vbEmptyString and vbNullString earlier :-).
Qu4 - mycell.formula = "" -- mycell.formula = null
I would say on one side you have a empty string and on the other side a null string. Now, they are different. However, in this case, it ends up being the same for Formula because when setting the formula, vb does the same than with the Trim function, it takes an inout (empty and null string) and transform (covert it) to fit Formula, and as with Trim it returns an empty string in both cases.
I am not completely 100% sure of what i say above, but that's the way i see it :-)
Regards,
Seb
Main Topics
Browse All Topics





by: mdmackillopPosted on 2004-05-04 at 16:24:36ID: 10991878
Hi Rberke,
Question 2 - I know you're trying to avoid VBA, but how about the following worksheet function
MD
Private Sub Worksheet_Change(ByVal Target As Range)
For Each acel In Target
acel.FormulaR1C1 = RTrim(acel)
Next
End Sub