How to mention a particular sheet name while opening excel with VB script.

R

refina

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.
 
F

FSt1

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top