08-19-2008, 01:02 PM
Thank you! but i am really new for macros. This is what i am doing, in Excel i put some values in column "A" to check your code, went to tools -->macros and type exactly the following code but it is giving me syntax error macro name is "deletenew"
Sub deletenew()
'/exe 1
'ExcelSheet es.Init ;;connect to Excel
ARRAY(int) ad
'rows to delete
ARRAY(str) ar
'row cells
int i n row
'for each row in used range
Row = es.ws.UsedRange.Row
foreach ar "" FE_ExcelRow
'is empty?
for(i 0 ar.len) if(ar[i].len) break
if(i=ar.len) ad[]=row ;;empty
Row 1
;delete starting from bottom
for i ad.len-1 -1 -1
Excel.Range r=es.ws.Rows.Item(ad[i])
r.Delete (Excel.xlUp)
End Sub
Do you know what is wrong ?
Thank you,
-Raaz
Sub deletenew()
'/exe 1
'ExcelSheet es.Init ;;connect to Excel
ARRAY(int) ad
'rows to delete
ARRAY(str) ar
'row cells
int i n row
'for each row in used range
Row = es.ws.UsedRange.Row
foreach ar "" FE_ExcelRow
'is empty?
for(i 0 ar.len) if(ar[i].len) break
if(i=ar.len) ad[]=row ;;empty
Row 1
;delete starting from bottom
for i ad.len-1 -1 -1
Excel.Range r=es.ws.Rows.Item(ad[i])
r.Delete (Excel.xlUp)
End Sub
Do you know what is wrong ?
Thank you,
-Raaz
