Private Sub Command2_Click()
On Error Resume Next
Dim vc
Shp(0).Top = Shp1.Top
Shp(0).Left = Shp1.Left
For h = 1 To 19
vc = h
Shp(h).Left = Shp1.Left
Shp(h).Top = Shp(h - 1).Height + Shp(h - 1).Top + 15
If Shp(h).Top + Shp(h).Height > Shp1.Height Then
MsgBox "YA PASO EL MAXIMO"
Exit For
' Shp(h).Left = Shp(0).Width + 100
End If
Next
MsgBox vc + 1
Shp(vc + 1).Top = Shp1.Top
'Aqui 'ta el problema me esta dando 0 el vc, voy a ver como lo arreglo
Shp(vc + 1).Left = Shp(vc - vc).Width + 125
vc = vc + 1
For h = vc + 1 To 19
vc = h
Shp(h).Left = Shp(h - vc).Width + 125
Shp(h).Top = Shp(h - 1).Height + Shp(h - 1).Top + 15
If Shp(h).Top + Shp(h).Height > Shp1.Height Then
MsgBox "YA PASO EL MAXIMO"
Exit For
End If
Next
MsgBox vc + 1
Shp(vc + 1).Top = Shp1.Top
Shp(vc + 1).Left = Shp(vc - vc).Width + 125
vc = vc + 1
For h = vc + 1 To 19
vc = h
Shp(h).Left = Shp(h - vc).Width + 125
Shp(h).Top = Shp(h - 1).Height + Shp(h - 1).Top + 15
If Shp(h).Top + Shp(h).Height > Shp1.Height Then
MsgBox "YA PASO EL MAXIMO"
Exit For
End If
Next
End Sub