View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default How to mention a particular sheet name while opening excel with VB

hi
this is from a macro i use to use.
reference the file name and complete file path.

Workbooks.Open Filename:="S:\PUBLIC\AE-MRP40\DollarsByLoc40.xls"

row count....
dim lastrow as long
lastrow = cells(Rows.Count, "A").End(xlUp).Row
'where A is the column
msgbox lastrow
column count....
dim lastcol as long
lastcol = Cells(1, Columns.Count).End(xlToLeft).Column
'where 1 is the row
msgbox lastcol

regards
FSt1

"refina" wrote:

Hi Pls say me
1. How to mention a particular sheet name while opening excel with VB script.
2.how to know the rowcount and column count in excel using vb script.