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

can somebody send the script to write a multiplication table in notepad through qtp

3 Answers   AppLabs,


How do client side image and server side image work?

0 Answers  


Dis advantages of XML checkpoint ?

0 Answers   Sapient,


What is the file extension of the code file and object repository file in QTP?

0 Answers  


what is object repository size?

22 Answers   ITC Infotech,






QTP identifying the child tabs in a maintab like tab_1,tab_2,tab_3,tab_4 while using a for loop for these tabs.its not proceeding from _1 to _2. How can i use "for loop "

2 Answers   Livetek,


what is the difference between the modular framework and datadriven frame work

2 Answers  


Hi, Can we open a test in qtp10 which is saved in qtp 9.2?

0 Answers  


In a web page when we enter the city name corresponding zip code is coming in the required field.Can any one please write how to test using QTP,whether this code is coming from Database or not.

1 Answers  


How to watch currnet value of an object like OK buton or edit box with "Agent Name:" label. in watch expression tab?

2 Answers   Cap Gemini,


How QTP recognizes Objects in AUT?

1 Answers   Crea,


hi.what is exactly mean by real time frame work? every institute teach Framework is nothing but having 6 to 7 folders..and save repositories functions keywords and scripts? this is enough or not? can we beleive?

1 Answers  


Categories