![]() |
Reading data from an Excel cell
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 |
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 |
Reading data from an Excel cell
That helps me too, thanks, but now how do I search for a specific text string (taken from a text box on a user form) in that range? Kristen -- Kristen ------------------------------------------------------------------------ Kristen's Profile: http://www.excelforum.com/member.php...o&userid=33199 View this thread: http://www.excelforum.com/showthread...hreadid=531402 |
All times are GMT +1. The time now is 01:24 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com