titi9030

Increase letter from A1.B1,C1,D1

5 posts in this topic

Good afternoon,

 

I am usiting the following code to write something from Html to excel, the problem is that it just writes the code in range B1 and overwrite again , there are four string I need to write increasing in range A1, B1, C1, D1, not in jus B1 overwriting..

 

 $aArray = _StringBetween($sHTML,'<DIV', '</DIV>')


$sLast = "A"
$iASCII = Asc($sLast)
$iASCII += 1
$sNext = Chr($iASCII)
for $a In $aArray
;ConsoleWrite($a & @CRLF)
_Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $a,  $sNext & 1)
sleep(1000)

Next

 

Thank you very much
 

Share this post


Link to post
Share on other sites

Put your data into a 2D array with 1 row and 4 columns and then use _Exce_RangeWrite to write the array to A1.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

 

Good evening, 

 

I tried to figure out how to use it from the helpfile, but unfortunatelly, it continue increasing the row B1.B2.B3,B4,  instead of column b1,c1,d1,e1

 

Could you please advise and let me know what is wrong? please see attahced how it looks

 

thank you very much

 

Local $aArray[4][4]

 $aArray = _StringBetween($sHTML,'<DIV', '</DIV>')


For $i = 0 To 4
    For $j = 0 To 4
       
    Next
 Next


for $a In $aArray
;ConsoleWrite($a & @CRLF)
_Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $aArray,  "b1")
sleep(1000)


Next

 

 

 

imagen.jpg

Share this post


Link to post
Share on other sites

When posting code could you please remove the empty lines and use code tags (the "<>" button in the editor)? Makes reading your code much easier ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Example how it schould work:

#include <Excel.au3>
Global $aArray[] = [1, 2, 3] ; 1D Array with 3 rows
_ArrayDisplay($aArray, "1D - 3 rows")
_ArrayTranspose($aArray) ; 2D array with 1 row, 3 columns
_ArrayDisplay($aArray, "2D - 1 row, 3 columns")
Global $oExcel = _Excel_Open()
Global $oWorkbook = _Excel_BookNew($oExcel)
Global $oRange = _Excel_RangeWrite($oWorkbook, Default, $aArray, "A1")

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now