hello all
i m using VB 6 for automating excel. My data contains some blank rows, which i need to get rid of. can anyone tell me how to do it.
help wud be appreciated.

If you know the row, you can use objectreference.EntireRow.Delete (objectreference is a reference to a range, I think). Or something like: xlApp.ActiveSheet.Range("2:10").Rows.Delete, might work for you. First you'll need to loop through and make sure the row in question is in fact blank, and then just run a delete on it. This reference might be of some help: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaxl11/html/xlmthDelete1_HV03076813.asp

thanks for the reply.. the problem is i dont know which rows are blank. but i m sure that there are many blank rows in the data.
looking forward to suggestions and helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.