Excel VBA planilha validação dados ferragem dobras
Este Macro do Aplicativo Microsoft Excel VBA(Visual Basic Application), Usaremos o procedimento no Evento Worksheet_Change da folha de Planilha para busca da imagem em outra folha de Planilha (Imagens), isto é, busca o desenho de acordo com a dobra da ferragem desejada.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 And Target.Count = 1 Then
‘– deleção shapes
For Each s In ActiveSheet.Shapes
If s.Type <> 8 Then
If s.TopLeftCell.Address = Target.Offset(0, 1).Address Then
s.Delete
End If
End If
Next s
‘–
If Target <> “” Then
vLin = [lista].Find(Target, LookAt:=xlWhole).Row
vCol = [lista].Column + 1
For Each s In Sheets(“Imagens”).Shapes
If s.TopLeftCell.Address = Cells(vLin, vCol).Address Then s.Copy
Next s
Target.Offset(0, 1).Select
ActiveSheet.Paste
Selection.ShapeRange.Left = ActiveCell.Left + 7
Selection.ShapeRange.Top = ActiveCell.Top + 5
Target.Select
End If
End If
End Sub

Aprenda tudo sobre planilhas do Aplicativo Microsoft Excel VBA(Visual Basic Application), sozinho, com baixo custo, praticando com os produtos didáticos Escola SaberExcel VBA Estudos® – Treinamentos com Macros, Fórmulas e Funções.
Compre pelo PagSeguro | Compre pelo PayPal | |
![]() |
![]() |
|
Material Didático: Curso Excel VBA Expert |
![]() |
![]() |
Baixe o exemplo de planilha contendo os macros acima: |
[email-download-link namefield=”YES” id=”233″] |
Baixe o exemplo de planilha contendo os macros acima: