View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Juan Eduardo Gorigoitía Juan Eduardo Gorigoitía is offline
external usenet poster
 
Posts: 3
Default Deleting rows to get in a format.

Hey thanks, it worked!

However, how can it make keep going down deleting the rows with Group Tot*
on it?

As it is deletes the first group, not the others

Thanks!

"keepITcool" wrote:

Try following..
it's quite fast provided the original list
hasn't got 500 group lines.

I assume the A3 is always the first data cell
I also assume the table is surrounded by empty cells
so the CurrentRegion will not pickup extraneous data.


Sub KillGroupLines()
Dim rng, r&

With ActiveSheet.Range("A3").CurrentRegion

'init the union with the empty cell
'below the currentregion

Set rng = .Rows(.Rows.Count + 1)

For r = 1 To .Rows.Count
If UCase$(.Cells(r, 1)) Like "GROUP TOT*" Then
Set rng = Union(rng, .Rows(r))
End If
Next
'remove the "init" cell
Set rng = Intersect(rng, .Cells)
If Not rng Is Nothing Then
rng.Delete Shift:=xlUp
End If

End With
End Sub



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


?B?SnVhbiBFZHVhcmRvIEdvcmlnb2l0w61h?=
wrote:

SatisfacciÇün Expectativas
Mean Std Deviation
Masculino 5,4 1,4
Femenino 3,8 2,2
Group Total 5,3 1,5
Menos de 2400 UF 5,9 ,9
2401 a 25 mil UF 5,6 1,2
25.001 a 100 mil UF 5,0 1,6
MÇÂ*s de 100.001 UF 4,3 2,3
No Responde 5,3 1,6
Group Total 5,3 1,5
Calidad y Certificacion 5,3 1,7
ComercializaciÇün 5,7 1,2
TecnologÇðas 5,2 1,6
GestiÇün 5,5 1,1
Exp. - PL - CG - ns/nr 6,0 ,
Group Total 5,3 1,5
Media 6,0 1,2
Tecnico Profesional 5,2 1,6
Universitario 5,2 1,4
Postgrado 5,3 1,6
Group Total 5,3 1,5