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

Hoe to generate all numbers in between to numbers suppose all numbers in between 1 to 100 using vbscript give me code

2 Answers  


what is the long form of QTP ?

2 Answers  


What is the main difference between QTP 8.0& QTP 9.2.And what r the features and benefits of QTP.

1 Answers   HCL,


How to swap two numbers by using parameter passing method byref in a fucntion and return the result to outside of the function?

1 Answers   CTS, IBM, London,


what is Synchronization point in QTP?Can anybody give a perfect example on it Thanks in advance

5 Answers  






How do we count the no of mails in Yahoo Inbox for a specified week?

0 Answers  


How qtp recognizes the object?

0 Answers  


write code to read and write data from file?

1 Answers   IBM,


Can we do Load Teting with QTP?

12 Answers  


What is the Maximum syncronization timeout in seconds in QTP 9.5

5 Answers   Polaris,


If already everything is tested using White-Box testing, then what is the need of using Black box testing?

3 Answers  


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

12 Answers  


Categories