VBA : Macro Button Not Work in 1 Sheet

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
1,743
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
hello all....

i'm looking for macro code to combine 3 button that works in 1 sheet..
here this code :

Code:
Sub Insert_Foto()

    Dim pic As Shape
    Dim picSource As Worksheet
    Dim cellFrames As Variant
    Dim index As Long
    
    Set picSource = Worksheets("SHeet1")
    index = 1
    For Each cellFrames In Range("$C$104:$J$109,$M$104:$R$109,$U$104:$AB$109,$AD$104:$AI$109").Areas
        Set pic = picSource.Shapes(index)
        pic.Copy
        ActiveSheet.Paste
        With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
            .Height = cellFrames.Height
            .Left = cellFrames.Left + ((cellFrames.Width - .Width) / 2)
            .Top = cellFrames.Top
        End With
        index = index + 1
    Next
    Do While picSource.Shapes.Count > 0
        picSource.Shapes(1).Delete
    Loop
Call Checklist_V
End Sub
Sub Checklist_V()


    Dim Cl As Range
    
    Application.ScreenUpdating = False
    With ActiveSheet
        For Each Cl In .UsedRange
            If Cl.Interior.ColorIndex = "14" And Not Cl.Value = "V" Then
                Cl.Value = "V"
            ElseIf Cl.Interior.ColorIndex = "14" And Cl.Value = "V" Then
                Cl.Interior.Color = xlNone
            End If
        Next Cl
    End With
    Application.ScreenUpdating = True
    
End Sub
Sub Delete_Photo()
For Each Shape In ActiveSheet.Shapes
If Shape.Name <> "Picture 1" Then
 Shape.Delete
End If
Next
End Sub

my button is 3 : Insert_Foto, Checklist_V, Delete_Foto..
how to 3 button is work well?

here my file :

http://jmp.sh/iVoUGv7

any help much appreciated...

m.susanto
 
Last edited:

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Watch MrExcel Video

Forum statistics

Threads
1,109,127
Messages
5,526,993
Members
409,733
Latest member
revender17

This Week's Hot Topics

Top