View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rishabh[_2_] Rishabh[_2_] is offline
external usenet poster
 
Posts: 5
Default Programmatically reading the excel sheet name--vbscript

Hi Jan Karel Pieterse,
Thanks allot! It worked.

Regards
Rishabh



"Jan Karel Pieterse" wrote:

Hi Rishabh,

Above line of code does the cell (B2) click and fetch the data into a new
sheet. I need to know in which sheet it displays the data.


AFAIK, this action always inserts a new worksheet to the immediate left of
the sheet the PT lives on, so:

Sheets(Sheet2.index-1) should give you that sheet.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com