Delete Hidden Data

  • Thread starter Thread starter SharonInGa
  • Start date Start date
S

SharonInGa

We sometimes get imported information with "noise" data.
How can I programatically delete the rows that appear
empty? Right now, I click on CTRL END and delete the
columns from the CTRL END point to the worksheeet with
info in it.


A B C D E F
1 Smith Atl GA
2 Jones Bir AL
3 Rose Oak CA CTR END

Programatically delete d1:f3
 
to delete empty rows:


Sub Del_lignes_Vides()
Dim r, DerniereLigne
DerniereLigne = ActiveSheet.UsedRange.Rows.Count
For r = DerniereLigne To 1 Step -1
If Application.CountA(Rows(r)) = 0 Then Rows(r).Delete
Next r
ActiveSheet.UsedRange
End Sub

Col:

Sub DetruireColVides()
dernierecol = ActiveSheet.UsedRange.Columns.Count
Application.ScreenUpdating = False
For r = dernierecol To 1 Step -1
If Application.CountA(Columns(r)) = 0 Then Columns(r).Delete
Next r
End Sub


--
....Patrick
Quoi que vous fassiez, faites le bien .
Mail: http://cerbermail.com/?KPW0tTCjFw
Connectez vous sur ce forum par :
news://msnews.microsoft.com/microsoft.public.fr.excel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top