Cell Values Not There ???

  • Thread starter Thread starter Alan
  • Start date Start date
A

Alan

I'm using VBA code in Excel 2007. I am having a strange problem. The
cells have content. Some of them, but not all of them, are selected
from Data Validation lists (drawn from a named range). However, when
I try to access their values in VBA, it says they are empty!''

For example, the simple code:

Debug.Print "Cell value is: " & ActiveSheet.Cells(2, 7).Value

results in the output:

Cell value is:

I even tried the following code, to make sure it was not a problem
with the ActiveSheet reference:

ThisWorkbook.Sheets("Form").Cells(2, 7).Value

but I got the same result.

What might be causing this problem??

I also tried saving, closing and reopening the worksheet, with the
same results.

Thanks in advance, Alan
 
Run this from the Immediate window:

ThisWorkbook.Sheets("Form").Cells(2, 7).interior.color=vbyellow

Does it highlight the cell you're trying to read from ?

Tim
 
Joel,
Good idea! It says the length is zero, and it highlights the
wrong cell (although that cell has data in it!).

However, Windows auto update is turned on, and only optional
updates are listed. I am using Excel 12.0.6514.5000 SP2 MSO
(12.0.6425.1000).

I tried saving as a macro-enabled workbook, closing it, then
reopening. Stil has the same problems.

Ideas? Thanks, Alan
 
Back
Top