How to fix ### field value programmatically.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to fix a problem with a column that displays ### instead of the
correct value programmatically. If I open the spreadsheet manually I can
widen the column and the values appear and it's done.

When I read the values programmatically I get ###s. I've tried to resolve
this by widening the column using Range.ColumnWidth as well as calling
RAnge.AutoFit() to no avail.

Any ideas anyone?
 
use the value property instead of the Text property and you shouldn't get the
###

activecell.EntireColumn.Autofit

should fit the column unless you have merged cells.
 
When you grab the value of the cell programatically use value instead of
text. this will grab the value of the cell, instead of the text displayed.

msgbox range("A1").Text 'shows #####
msgbox range("A1").value 'shows 12345
 
With this spreadsheet

range("A1").Text
range("A1").Value
range("A1").Value2

all show "#########". Also

range("A1").columnWidth = 500
range("A1").autofit()

do not resolve the problem.

if I open the same spreadsheet with Excel the column originally appears with
###s but if I expand the column the correct values appear.

Anyone else have any ideas???
 
Jim Thomlinson said:
When you grab the value of the cell programatically use value instead of
text. this will grab the value of the cell, instead of the text displayed.

msgbox range("A1").Text 'shows #####
msgbox range("A1").value 'shows 12345
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top