Private
Sub
CommandButton1_Click()
Select
Case
ComboBox1.ListIndex
Case
0
Case
1
Bild =
"c:\Logo1.jpg"
Case
2
Bild =
"c:\Logo2.jpg"
Case
3
Case
Else
End
Select
With
Range(ActiveWindow.RangeSelection.Address)
o = .Top
u = .Height + o
l = .Left
r = .Width + l
End
With
For
Each
p
In
ActiveSheet.Shapes
If
p.Top >= o
And
p.Top < u
And
p.Left >= l
And
p.Left < r
Then
p.Delete
Next
If
ComboBox1.ListIndex <> 0
Then
For
Each
Zelle
In
Range(a)
With
ActiveSheet.Pictures.Insert(Bild)
.Width = 8
.Height = 9.3
.Top = Zelle.Top
.Left = Zelle.Left
End
With
Next
End
If
End
Sub
Private
Sub
CommandButton2_Click()
Unload UserForm1
End
Sub
Private
Sub
UserForm_initialize()
CommandButton1.Caption =
"o.K."
CommandButton2.Caption =
"Abbrechen"
ComboBox1.AddItem
"kein Bild"
ComboBox1.AddItem
"Logo1"
ComboBox1.AddItem
"Logo2"
ComboBox1.ListIndex = 0
End
Sub