Thread: Dim c as Cell
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] meh2030@gmail.com is offline
external usenet poster
 
Posts: 135
Default Dim c as Cell

On Mar 21, 12:52*pm, Keith Howard
wrote:
Hello.

I have an embarrassingly simple question. How do I declare a variable as a
Cell? The above line is not compiling.

I have set the following Tools | References:
Visual Basic For Applications
Microsoft Excel 12.0 Object Library
OLE Automation
Microsoft Office 12.0 Object Library

I'm sure I have done this many times in the past successfully, but, for some
reason, it is not working now.

Thanks.

Keith


Keith,

I'm using Excel 2003, but the only way I know how to dimension a
variable as a "cell" is to dimension the variable as a range.

Dim rngMyCell As Range
Set rngMyCell = Range("A1")

You now have a range object (rngMyCell) which you can manipulate.

Best,

Matt Herbert