View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Alex B. Alex B. is offline
external usenet poster
 
Posts: 3
Default How to fix ### field value programmatically.

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" wrote:

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

--
HTH...

Jim Thomlinson


"Alex B." wrote:

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?