Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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
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
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Excel Discussion (Misc queries) 0 June 29th 09 11:20 AM
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 [email protected] Excel Worksheet Functions 1 August 22nd 08 02:04 AM
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 [email protected] Excel Programming 1 August 21st 08 10:13 PM
NEED VBA TO SELECT A CELL; NOTE THE CELL VALUE;COPYADJ CELL;FIND CELL VALUE IN A RANGE AND SO ON CAPTGNVR Excel Programming 2 July 8th 07 04:18 PM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM


All times are GMT +1. The time now is 06:32 PM.

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

About Us

"It's about Microsoft Excel"