View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Edwin Tam[_7_] Edwin Tam[_7_] is offline
external usenet poster
 
Posts: 94
Default Reading data from an Excel cell

the basic syntax for referring to a cell is:

Dim a
a = range("A1").value
or
a = range("A1:C15").value

If you want to refer the a cell in a particular sheet:
a = worksheets("Sheet1").range("A1").value

If you want to refer the a cell in a particular sheet in a specific workbook:
a = workbooks("Book1.xls").worksheets("Sheet1").range( "A1").value

Regards,
Edwin Tam

http://www.vonixx.com


"den1s" wrote:

Hi,

How would I retrieve data from a specific?

I am trying to write a program to extract the information from a
variety of cells, so I need a command which automates the whole
process. That is, I need to be able to refer to a cell using variables
as opposed to "A2".

Any help would be appreciated.

cheers

- D