Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por refernande
Posts
#54327
Boa Tarde,
Estou usando um código mais ele não está funcionado conforme deveria.
Preciso que ele delete imagens conforme intervalo obedecendo o critério da ultima linhas.
1) Preciso que ele encontra a ultima linha preenchida da C1048576 até ultima coluna e delete as imagens que se encontrarem dentro da seleção.

Sub RemoverIntervalo()

On Error Resume Next
Dim img As Shape

Linha = Range("C1048576").End(xlUp).Select
Coluna = Range("C1048576").End(xlToRight).Select

For Each img In ActiveSheet.Shapes
If Not Application.Intersect(img.TopLeftCell, ActiveSheet.Range(Linha & ":" & Coluna)) Is Nothing Then
img.Delete

End If
Next

End Sub
#54354
Tente isso:
Código: Selecionar todos
Public Sub RemoverIntervalo()
    Dim Linha As Long
    Dim img As Shape
    
    With Planilha1
        Linha = .Range("C1048576").End(xlUp).Row
        
        For Each img In ActiveSheet.Shapes
            If Not Application.Intersect(img.TopLeftCell, .Range(Linha & ":" & Linha)) Is Nothing Then
                img.Delete
            End If
        Next
    End With
End Sub
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord