Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Code not working as expected.
I have a snippet of a code shown below, when
c.value=3 and c1.value= "Cluster 3", i is still showing zero. I can't figut=re out what is going on here. The only thing I noticed is that c.values are double and c1.values are strings. I don't know if that makes any difference. Please help. For Each c1 In Worksheets(1).Range("A39:A46").Cells i = 0 For Each c In clusterRange.Cells If c.Value = Mid(c1.Value, 9) Then i = i + 1 End If Next c c1.Offset(0, 1).Value = i |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Code not working as expected.
Try Mid(C1.Value,9)*1 to convert the text from the Mid formula to a number.
"Ayo" wrote: I have a snippet of a code shown below, when c.value=3 and c1.value= "Cluster 3", i is still showing zero. I can't figut=re out what is going on here. The only thing I noticed is that c.values are double and c1.values are strings. I don't know if that makes any difference. Please help. For Each c1 In Worksheets(1).Range("A39:A46").Cells i = 0 For Each c In clusterRange.Cells If c.Value = Mid(c1.Value, 9) Then i = i + 1 End If Next c c1.Offset(0, 1).Value = i |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Code not working as expected.
Thanks Jason. That seems to do the trick.
"Jason" wrote: Try Mid(C1.Value,9)*1 to convert the text from the Mid formula to a number. "Ayo" wrote: I have a snippet of a code shown below, when c.value=3 and c1.value= "Cluster 3", i is still showing zero. I can't figut=re out what is going on here. The only thing I noticed is that c.values are double and c1.values are strings. I don't know if that makes any difference. Please help. For Each c1 In Worksheets(1).Range("A39:A46").Cells i = 0 For Each c In clusterRange.Cells If c.Value = Mid(c1.Value, 9) Then i = i + 1 End If Next c c1.Offset(0, 1).Value = i |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help !!! My code is not working as expected. | Excel Discussion (Misc queries) | |||
Iserror not working as expected | Excel Worksheet Functions | |||
Auto Fill - working as expected? | New Users to Excel | |||
=NETWORKDAYS not working as expected and as it once did | Excel Worksheet Functions | |||
Lookup Not working as expected | New Users to Excel |