Ad Home

Theme images by kelvinjay. Powered by Blogger.

Travel

Header Ads

Java

Selenium

UFT

Framework

General QA Concept

BDD

» » Getting Excel Sheet Name in QTP

Hi Here is some code to get Sheet name of a Excell.
Sub MsgBoxAllMySheets()
Dim sht As Worksheet
For Each sht In Sheets
MsgBox sht.name
Next sht
End Sub

Now if you need to customize the code....i.e--If you need a particular sheet..
simple just put the below code
sSheetName="abc" 'Sheet to be searched
Sub MsgBoxAllMySheets(sSheetName)
Dim sht As Worksheet
For Each sht In Sheets
MsgBox sht.name
if sht.name="sSheetName" Then
msgbox "Success"
end if
Next sht
End Sub

«
Next
Newer Post
»
Previous
Older Post

No comments:

Leave a Reply