Jump to content

Recommended Posts

Posted (edited)

Hi Guys

I know how to write to a excel column (to replace data) if it is a set amount of rows. (ie 20 rows)

How do I make a loop to write to a column until there is no more data to replace.

I want to run a continues loop replacing data in a column till there is no data to be replaced

eg: column 3 is "customer name" now the name needs to be changed. The length of rows vary from client to client.

Alistair

Edited by CEBSS
Posted

Do 
;Excel write 
Until $data = ""

where $data is the text string you want to write

Sorry i am still clueless.

There should be a AUTOIT FOR DUMMIES for peaple like myself.

Posted (edited)

Sorry i am still clueless.

There should be a AUTOIT FOR DUMMIES for peaple like myself.

something like this:

#include <Excel.au3>

Local $oExcel = _ExcelBookNew() ;Create new book, make it visible

For $i = 1 To 5 ;Loop
    _ExcelWriteCell($oExcel, $i, $i, 1) ;Write to the Cell
Next
$i = 1
Global $x = -1
Do
    $sCellValue = _ExcelReadCell($oExcel, $i, 1)
    $i = $i + 1
    $x = $x + 1
Until $sCellValue = ""

For $i = 1 To $x
    _ExcelWriteCell($oExcel, "Value", $i, 1)
Next
Edited by anunes

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
×
×
  • Create New...