Can you write a script for to insert array elements in an
excel A to Z columns only. if the number oe elements in the
array is greater than the number of columns (A to Z), come
to next row and proceed furthur. eah cell should contain
only one array value.



Can you write a script for to insert array elements in an excel A to Z columns only. if the number..

Answer / dwarapudi.mca

Dim arr
n=inputbox("Enter Array size")
ReDim arr(n)
For i=0 to n
arr(i)=cint("1")+Cint(i)
Next
Set Excl=CreateObject("Excel.Application")
Excl.workbooks.open("C:\Ex.xlsx")
Set ExclSht=Excl.Sheets.Item("Sheet1")
LOP=int((Ubound(arr)/cint(26))+1)
For i=0 to LOP
For j=0 to 25
If (j+k)<=ubound(arr) Then
ExclSht.cells(i+1,j+1)=arr(j+k)
else
Exit for
End If
Next
k=k+j
Next
Set ExclSht=nothing
Set Excl=nothing



Please let me know if u have simplest answer than this.

Thx

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More QTP Interview Questions

What is the ur roles and responsibilities as automation testing engineer?

2 Answers   Atos Origin,


Hi Friends, while playing the recorded test i am getting this error "Cannot identify the object "q" (of class WebEdit). Verify that this object's properties match an object currently displayed in your application." error is coming in this line of code "Line (2): "Browser("Google").Page("Google").WebEdit("q").Set "airtel broadband"". " .... please tell me how to overcome this problem. need help asap... Thanx in advance

3 Answers  


how to acess a test in RSA?

0 Answers   IBM,


How can we export test results to an excel sheet in QTP??? Can any one provide sample coding for this?????

6 Answers   TCS,


How can we check whether a particular sheet loaded (existed) or not in Data Table.

7 Answers   TCS,


How to test the mandatory fields in QTP?

1 Answers   SoftSolve, TE,


I want to learn Advanced QTP, suggest me the best faculty in Hyderabad

12 Answers  


Does QTP10 supports Windows 7OS +IE 9 combination? Which is the preffered combination ,Plz let me know?

0 Answers  


what are the parameters you are considering for object identification?

1 Answers  


What are output values and why they are used ?

0 Answers  


What are the five challenges you faced in QTP?

0 Answers   CTS,


What are the different ways to invoke an application using QTP?

0 Answers  


Categories