Count backwards

L

leonidas

Hi,

I have the following macro but it won't work, because, what I think
the backward counting "For i = 10 To 1" doesn't work.
Is there a solution for this problem so it can count backwards o
change the names of the ComboBoxes from 10 to 1 ? Thanks in advance!


Code
-------------------
Sub Test()

Dim ws As Worksheet
Dim i As Long

Set ws = ActiveSheet

For i = 10 To 1
Call LinkCombo(ws.OLEObjects("ComboBox" & i), "ComboBox" & i + 1)
Next i

End Sub
Private Sub LinkCombo(pCombo As OLEObject, pName As String)

With pCombo
.Name = pName
End With

End Su
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top