mribadeneira
New Member
- Joined
- Apr 10, 2013
- Messages
- 7
I am having problems getting my program to work.
First, I cant get the FindMe function to work, i get the error Object doesn't support this property or method. I am not really sure whats wrong.
My second problem is I have variables NB1 through NB8 defined in the main Sub and I want this program to loop using all of them in turn. However I get the error that the variable NBi is not defined. How can i set the code up so that by using a statement like
it runs thorugh all the NB variables?
My code is below to see if you can spot any mistakes. Any help is greatly appreciated!
TEA, Participacion, and Monto are select boxes in a Userform.
First, I cant get the FindMe function to work, i get the error Object doesn't support this property or method. I am not really sure whats wrong.
My second problem is I have variables NB1 through NB8 defined in the main Sub and I want this program to loop using all of them in turn. However I get the error that the variable NBi is not defined. How can i set the code up so that by using a statement like
Code:
For i = 1 To 8
My code is below to see if you can spot any mistakes. Any help is greatly appreciated!

Code:
Private Sub CollectDataOp1()
Dim i As Integer
Sheets("Datos").Select
Range("A1").Select
With Worksheets("Datos").Range(Selection, Selection.End(xlDown))
Set c = .FindMe.fecha.Value , LookIn:=xlValuese
If Not c Is Nothing Then
firstaddress = c.Address
Do
For i = 1 To 8
If c.Offset(0, 2).Value = NBi & " " & r1 Then
If opcion1.TEA.Value = True Then
BP1 = c.Offset(0, 4)
Sheets("Resultados").Select
Range("A3").Select
Range(Selection.End(xlToRight)).Offset(0, 1) = BP1
Sheets("Datos").Select
End If
If opcion1.Participacion.Value = True Then
BP1 = c.Offset(0, 5)
Sheets("Resultados").Select
Range("A3").Select
Range(Selection.End(xlToRight)).Offset(0, 1) = BP1
Sheets("Datos").Select
End If
If opcion1.Monto.Value = True Then
BP1 = c.Offset(0, 6)
Sheets("Resultados").Select
Range("A3").Select
Range(Selection.End(xlToRight)).Offset(0, 1) = BP1
Sheets("Datos").Select
End If
End If
Next i
Loop While Not c Is Nothing And c.Address <> firstaddress
End If
End With
End Sub
TEA, Participacion, and Monto are select boxes in a Userform.