VBA : Macro Button Not Work in 1 Sheet

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,077
Office Version
  1. 365
  2. 2021
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:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top