Hi jdf726,
> Can you explain why writing text data directly into a range doesn't work?
> I don't often write text to cells, but I think I have ended up using 'cell' which is described as being 'older'
> in the documentation.
Range is simply a range of cell block or a column - it doesn't care whether it contains the numbers of strings there.
Type mismatching occurs in assignment when destination is received. If you want to receive the Text data in destination,
you can explicitly mark with "$" sign in the assignment.
//When the destination column is "Text" or "Text & Numeric" type:
range rB=col(B);
rB[1]$="High"; (or col(B)[1]$="High";)
==> OK. Original string "High" is set to the cell
rB[1]="High"; (or col(B)[1]="High";)
==> Error by mismatched data types. The cell gets "--".
//When the destination column is "Text" type:
col(B)[1]$="009"; (or col(B)[1]$=009;)
==> OK. Original string "009" is set to the cell
col(B)[1]=009;
==> OK, but converted string "9" is set to the cell
col(B)[1]="009";
==> Error by mismatched data types. The cell gets "--".
//When the destination column is "Numeric" type:
col(B)[1]="0999";
==>Error of mismatched data type
col(B)[1]=999;
==>OK. It gets 999.
col(B)[1]$="ABC";
==>Error of mismatched data type. The cell gets "--".
col(B)[1]$="00999";
==> OK. At end, the cell gets 999.
Note: In the Set Column Values tool, the left-side of the equation (just above the box
for right-side) doesn't show $ like "Col(B)=", but in this case, for your convenience,
string assignment works.
I hope this explanation is understandable.
--Hideo Fujii
OriginLab