muhammad susanto
Well-known Member
- Joined
- Jan 8, 2013
- Messages
- 2,102
- Office Version
- 365
- 2021
- Platform
- Windows
hello all....
i'm looking for macro code to combine 3 button that works in 1 sheet..
here this code :
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
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: