Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dim c as Cell
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dim c as Cell
Try:
DIM C As Range A cell is a range containing only one cell. "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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dim c as Cell
Cell is not a valid object class. You declare a cell as a Range.
Dim c As Range "Keith Howard" wrote in message ... 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Worksheet Functions | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Programming | |||
NEED VBA TO SELECT A CELL; NOTE THE CELL VALUE;COPYADJ CELL;FIND CELL VALUE IN A RANGE AND SO ON | Excel Programming | |||
How to create/run "cell A equals Cell B put Cell C info in Cell D | Excel Discussion (Misc queries) |