Dim c as Cell

K

Keith Howard

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
 
M

meh2030

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top