Notifications
Clear all

Copiar e ou remover imagens de comentários.

3 Posts
2 Usuários
0 Reactions
599 Visualizações
(@fernandofernandes)
Posts: 43750
Illustrious Member
Topic starter
 

Senhores, bom dia.
Por gentileza, gostaria, se possível, da ajuda dos senhores.
Alguém conhece alguma forma de copiar e ou remover as imagens colocadas em comentários?

Grato a todos.

 
Postado : 18/09/2016 6:03 am
(@basole)
Posts: 487
Reputable Member
 

segue exemplos:

Sub Copia_Img_Comentario()
    Dim rngCol As Range, rng As Range

    On Error Resume Next
    Set rngCol = Intersect(ActiveSheet.Cells.SpecialCells(xlComments), Range("A:A"))

    For Each rng In rngCol
        With rng
            .Comment.Visible = True
            .Comment.Shape.Select
            .Comment.Shape.CopyPicture _
                    Appearance:=xlScreen, Format:=xlPicture
            .Comment.Visible = False
            .Offset(0, 2).PasteSpecial    ' copia p/ coluna C
        End With
    Next

End Sub

Sub Deletar_Img_Comentario()
Dim rngCol As Range, rng As Range

On Error Resume Next
Set rngCol = Intersect(ActiveSheet.Cells.SpecialCells(xlComments), Range("A:A"))

For Each rng In rngCol
    With rng
    .Comment.Shape.Delete
  '  .Comment.Delete 'Remove Comentario
    End With
Next

End Sub
 
Postado : 19/09/2016 11:13 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
Topic starter
 

Oi Basole.
Em primeiro gostaria de agradecer a boa vontade em me ajudar.
Olha só:
O primeiro código faz a cópia. Porém, quanto o deletar a imagem está dando um erro. Dá finalizar programa.

 
Postado : 19/09/2016 3:16 pm