Autoajustar tablas al borrar registro
Para Dante Amor
Mira, lo que necesito es que al borrar un elemento de la tabla, esta se autoajuste sola para que no me genere espacios en blanco.

Y en esta que se borre el contenido y se autoajuste

El código que tengo es:
Public valor
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c, h, b, u
If Target.Count > 1 Then Exit Sub
If Target.Row = 1 Then Exit Sub
If Not Intersect(Target, Range("B:B")) Is Nothing Then
For Each c In Target
Set h = Sheets("CARACTERISTICAS DEL PROYECTO")
If c = "" And valor <> "" Then
Set b = h.Columns("N").Find(valor, lookat:=xlWhole)
If Not b Is Nothing Then
b.Value = ""
End If
Else
Set b = h.Columns("N").Find(c.Value, lookat:=xlWhole)
If b Is Nothing Then
u = h.Range("N" & Rows.Count).End(xlUp).Row + 1
h.Cells(u, "N") = c.Value
End If
End If
Next
End If
End Sub
'
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Row = 1 Then Exit Sub
If Not Intersect(Target, Range("B:B")) Is Nothing Then
If Target.Value <> "" Then
valor = Target.Value
End If
End If
End Sub
1 Respuesta
Respuesta de Dante Amor
1
