Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 367
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help !!! My code is not working as expected. Ayo Excel Discussion (Misc queries) 3 August 30th 07 10:39 PM
Iserror not working as expected NathanG Excel Worksheet Functions 5 February 1st 07 05:31 PM
Auto Fill - working as expected? LynnS New Users to Excel 1 October 17th 06 08:20 PM
=NETWORKDAYS not working as expected and as it once did USAOz Excel Worksheet Functions 2 July 13th 06 03:02 PM
Lookup Not working as expected trumpy81 New Users to Excel 5 June 30th 05 07:41 PM


All times are GMT +1. The time now is 09:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"