Problem with VB more than 10
Solved/Closed
Related:
- Problem with VB more than 10
- Vb select case - Guide
- Vb code maker aljzazy - Download - Other
- Vb editor download - Download - IDE
- Vb round up - Guide
- Vb color codes list - Guide
3 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Feb 19, 2010 at 08:07 AM
Feb 19, 2010 at 08:07 AM
Could you provide the data that you are using to test and expected result. May be put the sheet at some share site with you test data and expected results like https://authentification.site
I am not clear on your loops like For r = 10 To 10
I am not clear on your loops like For r = 10 To 10
yeah sorry i was just looping it along one row to try and figure it out.
i am going to make it into a much larger data base search program with alot more search criteria so thats why i was lopping it round some and not others.
https://authentification.site/files/21018150/Search_prog.xls
i am going to make it into a much larger data base search program with alot more search criteria so thats why i was lopping it round some and not others.
https://authentification.site/files/21018150/Search_prog.xls
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Feb 19, 2010 at 09:01 AM
Feb 19, 2010 at 09:01 AM
You have declared S() to be of type string. So it is doing comparing a string with a number and hence your issue
you can do some thing like that
If (IsNumeric(s(x)) And IsNumeric(Cells(r, col(x)))) Then
If CDbl(s(x)) >= CDbl(Cells(r, col(x))) Then
Worksheets("sheet2").Range(inputy(x)) = 1
End If
ElseIf s(x) >= ws.Cells(r, col(x)) Then
Worksheets("sheet2").Range(inputy(x)) = 1
End If
Also by the way "tues" and "Tues" also failed on test (case issue of letter T)
you can do some thing like that
If (IsNumeric(s(x)) And IsNumeric(Cells(r, col(x)))) Then
If CDbl(s(x)) >= CDbl(Cells(r, col(x))) Then
Worksheets("sheet2").Range(inputy(x)) = 1
End If
ElseIf s(x) >= ws.Cells(r, col(x)) Then
Worksheets("sheet2").Range(inputy(x)) = 1
End If
Also by the way "tues" and "Tues" also failed on test (case issue of letter T)