Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to delete empty rows
#3
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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)