Thread: Count backwards
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
leonidas[_30_] leonidas[_30_] is offline
external usenet poster
 
Posts: 1
Default Count backwards


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
-------------------

--
leonida
-----------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...fo&userid=3537
View this thread: http://www.excelforum.com/showthread.php?threadid=55686