Excel - Eliminar filas

 
Vista:
sin imagen de perfil

Eliminar filas

Publicado por yooqui (7 intervenciones) el 17/01/2015 23:49:27
Tengo una hoja llamada Mat1 que ha sido generada por una macro, pero me crea filas con el contenido "Este estándar de aprendizaje no ha sido seleccionado para evaluar este trimestre" y quiero eliminarlas.
La verdad que tengo varias hojas, donde tengo que eliminar "Este estándar de aprendizaje..........."


Ver enlace de las filas a eliminar.

https://dl.dropboxusercontent.com/u/106819383/apoyo1%C2%BA.xlsm



¿Cómo puedo eliminar dichas filas?. Pueden poner el código entero, porque no acierto.

Un saludo y gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Eliminar filas

Publicado por juan pablo (7 intervenciones) el 19/01/2015 13:01:47
presiona alt + f11
doble click en
Hoja27 (MAT3)

elimina la codificación similar a esta y listo


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Private Sub Worksheet_Activate()
Range("B4:B140").Select
    Selection.FormatConditions.Add Type:=xlTextString, String:= _
        "Este estándar de aprendizaje no ha sido seleccionado para evaluar este trimestre" _
        , TextOperator:=xlContains
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .Pattern = xlGray25
        .PatternColor = 12611584
        .ColorIndex = xlAutomatic
        .PatternTintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False
    Rows("4:140").Select
    Selection.RowHeight = 26
End Sub
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
 
End Sub

saludos
JPP
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de LaO

Eliminar filas

Publicado por LaO (67 intervenciones) el 19/01/2015 15:33:16
Hola Yooqui,

Adjunto el libro con el módulo "General" que contiene el código de la solución. El detalle de la rutina es como se indica:

Nota: En el parámetro strSheet puedes colocar el nombre de la hoja que te interesa evaluar para borrar las filas con el texto que desees, el cual igualmente está contenido en la variable strParam

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Public Sub DeleteParams()
 
Dim i As Long, n As Long
Dim strSheet As String, strParam As String, strRangeParam As String
 
On Error GoTo x
 
'vars
strSheet = "MAT1"
strParam = "Este estándar de aprendizaje no ha sido seleccionado para evaluar este trimestre"
n = WorksheetFunction.CountA(Sheets(strSheet).Range("A:A"))
strRangeParam = Empty
 
'app control
Application.ScreenUpdating = False
 
'explore data
For i = 1 To n
 
    If Sheets(strSheet).Cells(i, 2) = strParam Then
 
        'get params range
        If strRangeParam = Empty Then
        strRangeParam = CStr(i) & ":" & CStr(i)
        Else
        strRangeParam = strRangeParam & "," & CStr(i) & ":" & CStr(i)
        End If
 
    End If
 
Next i
 
'delete params range
Sheets(strSheet).Range(strRangeParam).Delete Shift:=xlUp
 
'app control
Application.ScreenUpdating = True
 
'final message
MsgBox "Proceso finalizado.", vbInformation, "Mensaje"
 
Exit Sub
 
x:
 
MsgBox "Error : " & Err.Description, vbCritical, "Mensaje"
 
End Sub

Un saludo,
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar
sin imagen de perfil

Eliminar filas

Publicado por yooqui (7 intervenciones) el 20/01/2015 01:19:02
Dios..muchas gracias..¡¡qué maquinas sois...¡¡
Funciona..que chuloo.......
xaooo
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar