View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default VBA Assigning cell value to variable giving runtime error

"KeriM" wrote:
Here is my code that is giving me the above mentioned error:
[....]

ComboVal = Sheets("DATA").Cells(i,DropDown_txt).value
[....]
I've also tried it this way with the same resulting error:
[....]

ComboVal = Sheets("DATA").Cells(i, 60).value

[....]
I solved my own problem. I had declared "DropDown_Txt" as a String.
When I declared it as an Integer, that fixed the problem.


That does not explain why Cells(i,60) failed.

Did you mistype the example in your posting, inadvertently correcting the
syntax error, or otherwise misrepresent the facts?