Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Cell Values Not There ???

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell Values Not There ???


What happen is you do this?

msgbox(ThisWorkbook.Sheets("Form").Cells(2, 7).Value)
msgbox("book : " & thisworkbook.name)


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=157567

Microsoft Office Help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Cell Values Not There ???

The first window is blank. The second window shows the correct
Workbook name.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell Values Not There ???


Remove Value.

msgbox(ThisWorkbook.Sheets("Form").Cells(2, 7))
msgbox("book : " & thisworkbook.name)


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=157567

Microsoft Office Help

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Cell Values Not There ???

No difference. I have never run into this problem before.

Any other ideas?


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Cell Values Not There ???

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" wrote in message
...
No difference. I have never run into this problem before.

Any other ideas?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell Values Not There ???


Make sure you have all the updates to 2007. Lots of bugs. Also there
may be spaces white spaces in the data. I often use theis for
debugging

msgbox(len(ThisWorkbook.Sheets("Form").Cells(2, 7)))

When I 'm not sure if there is data in the cell I check the length of
the data to be sure.


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=157567

Microsoft Office Help

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLookup multiple values - sum returned values into single cell se7098 Excel Worksheet Functions 12 April 2nd 23 07:32 PM
Copy values from a cell based on values of another cell Spence10169 Excel Discussion (Misc queries) 4 January 13th 09 10:01 AM
How to assign values to a cell based on values in another cell? Joao Lopes Excel Worksheet Functions 1 December 5th 07 09:02 PM
Search/Filter to find values in another range based on two cell values Andy Excel Programming 2 April 29th 04 04:08 PM


All times are GMT +1. The time now is 03:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"