Function
logo_test()
i = 5
j = 20
a = Application.WorksheetFunction.CountIf(Range(Cells(i, 2), Cells(j, 2)),
"1"
)
b = Application.WorksheetFunction.CountIf(Range(Cells(i, 2), Cells(j, 2)),
"2"
)
c = Application.WorksheetFunction.CountIf(Range(Cells(i, 2), Cells(j, 2)),
"3"
)
If
a > 0
Then
Logo_verschieben_a (a,b,c)
End
If
If
b > 0
Then
Logo_verschieben_b (a,b,c)
End
If
If
c > 0
Then
Logo_verschieben_c (a,b,c)
End
If
End
Function
Function
Logo_verschieben_a (
ByVal
a,
ByVal
b,
ByVal
c)
If
a
Mod
2 <> 0
Then
k = 5 + (a + 1) / 2
jsum = 0
Else
: k = 5 + a / 2
jsum = 12
End
If
Set
start_cell = ActiveSheet.Cells(k, 2)
isum = -38
ActiveSheet.Shapes(
"Picture_a"
).Visible =
True
ActiveSheet.Shapes(
"Picture_a"
).
Select
Selection.Copy
ActiveSheet.Paste
With
Selection.ShapeRange
.Name =
"Picture 1"
.Visible =
True
For
i = 1
To
start_cell.Column
isum = isum + Columns(i).Width
Next
i
For
j = 1
To
start_cell.Row
jsum = jsum + Rows(j).Height
Next
j
.left = isum
.top = jsum
.left = .left - start_cell.Width
.top = .top - start_cell.Height
End
With
End
Function