PC Review


Reply
Thread Tools Rate Thread

Cell Values Not There ???

 
 
Alan
Guest
Posts: n/a
 
      27th Nov 2009
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
 
Reply With Quote
 
 
 
 
Alan
Guest
Posts: n/a
 
      27th Nov 2009
The first window is blank. The second window shows the correct
Workbook name.
 
Reply With Quote
 
Alan
Guest
Posts: n/a
 
      27th Nov 2009
No difference. I have never run into this problem before.

Any other ideas?
 
Reply With Quote
 
Tim Williams
Guest
Posts: n/a
 
      27th Nov 2009
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

"Alan" <(E-Mail Removed)> wrote in message
news:66546061-f732-4209-9790-(E-Mail Removed)...
> No difference. I have never run into this problem before.
>
> Any other ideas?



 
Reply With Quote
 
Alan
Guest
Posts: n/a
 
      28th Nov 2009
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
 
Reply With Quote
 
Alan
Guest
Posts: n/a
 
      28th Nov 2009
Never mind! User error!!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy values from a cell based on values of another cell Spence10169 Microsoft Excel Misc 4 13th Jan 2009 10:01 AM
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 tviola@wi.rr.com Microsoft Excel Discussion 1 22nd Aug 2008 12:32 AM
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 tviola@wi.rr.com Microsoft Excel Programming 1 21st Aug 2008 10:13 PM
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 tviola@wi.rr.com Microsoft Excel Worksheet Functions 0 21st Aug 2008 08:44 PM
How to assign values to a cell based on values in another cell? Joao Lopes Microsoft Excel Worksheet Functions 1 5th Dec 2007 09:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 AM.