give debug :( thanks anyway

2015-01-12 17:23 GMT+02:00 Vaibhav Joshi <v...@vabs.in>:

> try this code..
>
> Sub Test_4()
> Dim i As Long
> Dim countErr As Long
> countErr = 0
> i = 2
>
> For Each c In Range("A3:H6930")
> If c.Value > 0.18 And IsNumeric(c.Value) Then
> Cells(c.Row, 8).Interior.ColorIndex = 3
> countErr = countErr + 1
> End If
> Next c
>
> If countErr > 0 Then
> Sheets("test").Select
> Range("E8").Select
> Selection.Interior.ColorIndex = 3
> Range("D8").Select
> Selection.FormulaR1C1 = countErr
> Else
>
> Sheets("test").Select
> Range("E8").Select
> Selection.Interior.ColorIndex = 4
> Sheets("test").Range("d8") = "0"
> End If
> End Sub
>
>
> Cheers!!
> ᐧ
>
> On Mon, Jan 12, 2015 at 8:47 PM, liron glam <gliron11041...@gmail.com>
> wrote:
>
>> But the numbers i want it to paint are only in column 8, cause in the
>> other ones i have other numbers and i don't want it to paint recording to
>> them
>>
>> 2015-01-12 16:44 GMT+02:00 Vaibhav Joshi <v...@vabs.in>:
>>
>>> what is your data range ?
>>>
>>> E.G. Your data range is B5:I100 then replace *A2:*H5 with the same..
>>>
>>> See attach file for sample..
>>>
>>> Cheers!!
>>> ᐧ
>>>
>>> On Mon, Jan 12, 2015 at 8:08 PM, liron glam <gliron11041...@gmail.com>
>>> wrote:
>>>
>>>> it still doesnt work, i need it to do the check only on the 8 column,
>>>> cause that's where the percents are,
>>>> any other idea?
>>>> thanks!!
>>>>
>>>> 2015-01-12 16:27 GMT+02:00 Vaibhav Joshi <v...@vabs.in>:
>>>>
>>>>> Hi Liron
>>>>>
>>>>> try below code..
>>>>>
>>>>> *Sub Test_4()*
>>>>> *Dim i As Long*
>>>>> *Dim countErr As Long*
>>>>> *countErr = 0*
>>>>> *i = 2*
>>>>>
>>>>> *For Each c In Range("A2:H5") '<<change A2:H5 to your range*
>>>>> *If c.Value > 0.18 And IsNumeric(c.Value) Then*
>>>>> *c.Interior.ColorIndex = 3*
>>>>> *countErr = countErr + 1*
>>>>> *End If*
>>>>> *Next c*
>>>>>
>>>>> *If countErr > 0 Then*
>>>>> *Sheets("test").Select*
>>>>> *Range("E8").Select*
>>>>> *Selection.Interior.ColorIndex = 3*
>>>>> *Range("D8").Select*
>>>>> *Selection.FormulaR1C1 = countErr*
>>>>> *Else*
>>>>>
>>>>> *Sheets("test").Select*
>>>>> *Range("E8").Select*
>>>>> *Selection.Interior.ColorIndex = 4*
>>>>> *Sheets("test").Range("d8") = "0"*
>>>>> *End If*
>>>>> *End Sub*
>>>>>
>>>>>
>>>>> change *A2:H5 with your actual range..*
>>>>>
>>>>> *Cheers!!*
>>>>>
>>>>
>>>> On Mon, Jan 12, 2015 at 7:45 PM, liron glam <gliron11041...@gmail.com>
>>>> wrote:
>>>>
>>>>>
>>>>>
>>>>> I have big data file on excel, the file has 6930 rows and 8 columns,
>>>>> the 8 column has percents (0%, 4%, 16%, 18%, 19% and etc..)
>>>>> I tried to do a macro that paint all the rows that the percent in them
>>>>> are bigger then 18%, and it doesnt work, i would like to get some ideas 
>>>>> how
>>>>> to make it work, thanks in advance. The file start from row 3, so rows 1
>>>>> and 2 are empty The macro:
>>>>>
>>>>> Sub Test_4
>>>>>
>>>>> Dim i As Long
>>>>>
>>>>> Dim countErr As Long
>>>>>
>>>>> countErr = 0
>>>>>
>>>>> i = 2
>>>>>
>>>>> Do While Cells(i, 1) = ""
>>>>>
>>>>> If Cells(i, 8).Value > 0.18 And IsNumeric(Cells(i, 8)) Then
>>>>>
>>>>> Range(Cells(i, 1), Cells(i, 8)).Interior.ColorIndex = 3
>>>>>
>>>>> countErr = countErr + 1
>>>>>
>>>>> End If
>>>>>
>>>>> i = i + 1
>>>>>
>>>>> Loop
>>>>>
>>>>> If countErr > 0 Then
>>>>>
>>>>> Sheets("test").Select
>>>>>
>>>>> Range("E8").Select
>>>>>
>>>>> Selection.Interior.ColorIndex = 3
>>>>>
>>>>> Range("D8").Select
>>>>>
>>>>>       Selection.FormulaR1C1 = countErrElse
>>>>>
>>>>> Sheets("test").Select
>>>>>
>>>>> Range("E8").Select
>>>>>
>>>>> Selection.Interior.ColorIndex = 4
>>>>>
>>>>> Sheets("test").Range("d8") = "0"
>>>>> End If
>>>>>
>>>>> End Sub
>>>>>
>>>>> --
>>>>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be?
>>>>> It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>>>>> https://www.facebook.com/discussexcel
>>>>>
>>>>> FORUM RULES
>>>>>
>>>>> 1) Use concise, accurate thread titles. Poor thread titles, like
>>>>> Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need
>>>>> Advice will not get quick attention or may not be answered.
>>>>> 2) Don't post a question in the thread of another member.
>>>>> 3) Don't post questions regarding breaking or bypassing any security
>>>>> measure.
>>>>> 4) Acknowledge the responses you receive, good or bad.
>>>>> 5) Jobs posting is not allowed.
>>>>> 6) Sharing copyrighted material and their links is not allowed.
>>>>>
>>>>> NOTE : Don't ever post confidential data in a workbook. Forum owners
>>>>> and members are not responsible for any loss.
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "MS EXCEL AND VBA MACROS" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to excel-macros+unsubscr...@googlegroups.com.
>>>>> To post to this group, send email to excel-macros@googlegroups.com.
>>>>> Visit this group at http://groups.google.com/group/excel-macros.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>  --
>>>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be?
>>>> It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>>>> https://www.facebook.com/discussexcel
>>>>
>>>> FORUM RULES
>>>>
>>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>>>> will not get quick attention or may not be answered.
>>>> 2) Don't post a question in the thread of another member.
>>>> 3) Don't post questions regarding breaking or bypassing any security
>>>> measure.
>>>> 4) Acknowledge the responses you receive, good or bad.
>>>> 5) Jobs posting is not allowed.
>>>> 6) Sharing copyrighted material and their links is not allowed.
>>>>
>>>> NOTE : Don't ever post confidential data in a workbook. Forum owners
>>>> and members are not responsible for any loss.
>>>> ---
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "MS EXCEL AND VBA MACROS" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/excel-macros/wmDi40KLyWk/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> excel-macros+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to excel-macros@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/excel-macros.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>> --
>>>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be?
>>>> It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>>>> https://www.facebook.com/discussexcel
>>>>
>>>> FORUM RULES
>>>>
>>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>>>> will not get quick attention or may not be answered.
>>>> 2) Don't post a question in the thread of another member.
>>>> 3) Don't post questions regarding breaking or bypassing any security
>>>> measure.
>>>> 4) Acknowledge the responses you receive, good or bad.
>>>> 5) Jobs posting is not allowed.
>>>> 6) Sharing copyrighted material and their links is not allowed.
>>>>
>>>> NOTE : Don't ever post confidential data in a workbook. Forum owners
>>>> and members are not responsible for any loss.
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "MS EXCEL AND VBA MACROS" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to excel-macros+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to excel-macros@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/excel-macros.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  --
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/excel-macros/wmDi40KLyWk/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> excel-macros+unsubscr...@googlegroups.com.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros.
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to excel-macros+unsubscr...@googlegroups.com.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
> https://www.facebook.com/discussexcel
>
> FORUM RULES
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
> 2) Don't post a question in the thread of another member.
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
> 4) Acknowledge the responses you receive, good or bad.
> 5) Jobs posting is not allowed.
> 6) Sharing copyrighted material and their links is not allowed.
>
> NOTE : Don't ever post confidential data in a workbook. Forum owners and
> members are not responsible for any loss.
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "MS EXCEL AND VBA MACROS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/excel-macros/wmDi40KLyWk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> excel-macros+unsubscr...@googlegroups.com.
> To post to this group, send email to excel-macros@googlegroups.com.
> Visit this group at http://groups.google.com/group/excel-macros.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to