Skip to main content

Posts

Showing posts from March, 2021

Excel VBA - Differences between 'Text' and 'Value'

 Following the publication of ' What is a Cell Map? ', I was playing with the functionality and found some unexpected mapping presentations. On one worksheet the mapping delivered a block of constants - all coloured purple. Constants are coloured purple. But on the worksheet in question the software delivered the following. Yellow represents user entry cells . But I knew that the original spreadsheet (from which the map was derived) contained numbers in these cells. In fact they were a lookup table. The user should not have been allowed any where near them. On monitoring the code I found that the yellow cells were deemed to be empty, even though they clearly contained a number - in this case 7.  Monitoring code The code in question used the expression MyCell.Text. This did not recognise the 7 as a text value. Changing the expression to MyCell.Value brought about the desired effect. Although I have acheived the 'correct' result, testing has shown that MyCell.Text deliver