Re: $$Excel-Macros$$ Do while loop question

2015-05-14 Thread liron glam
Hello I have another problem with this macro code, whenever it's "#DIV/0!" its an error and the loop stops, what can i do to make it go further with the loop without coloring the error rows? Thanks in advance 2015-01-13 13:09 GMT+02:00 Ashish Kumar : > Nice Solution Vaibhav Sir. > > > Regards >

Re: $$Excel-Macros$$ Do while loop question

2015-01-13 Thread Ashish Kumar
Nice Solution Vaibhav Sir. Regards Ashish -- 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 titl

Re: $$Excel-Macros$$ Do while loop question

2015-01-13 Thread Vaibhav Joshi
Cheers!! ᐧ On Tue, Jan 13, 2015 at 3:49 PM, liron glam wrote: > PERFECT! thanks alot!!! > > 2015-01-13 12:15 GMT+02:00 Vaibhav Joshi : > >> This will not paint error.. >> >> Sub Test_4() >> Dim i As Long >> Dim countErr As Long >> countErr = 0 >> i = 2 >> >> On Error GoTo err: >> For Each c In R

Re: $$Excel-Macros$$ Do while loop question

2015-01-13 Thread liron glam
PERFECT! thanks alot!!! 2015-01-13 12:15 GMT+02:00 Vaibhav Joshi : > This will not paint error.. > > Sub Test_4() > Dim i As Long > Dim countErr As Long > countErr = 0 > i = 2 > > On Error GoTo err: > For Each c In Range("H2:H6930") 'A2:H30 > If c.Value > 0.18 And IsNumeric(c.Value) Then > Range(

Re: $$Excel-Macros$$ Do while loop question

2015-01-13 Thread Vaibhav Joshi
This will not paint error.. Sub Test_4() Dim i As Long Dim countErr As Long countErr = 0 i = 2 On Error GoTo err: For Each c In Range("H2:H6930") 'A2:H30 If c.Value > 0.18 And IsNumeric(c.Value) Then Range(Cells(c.Row, 1), Cells(c.Row, 8)).Interior.ColorIndex = 3 countErr = countErr + 1 End If er

Re: $$Excel-Macros$$ Do while loop question

2015-01-13 Thread liron glam
thank you, its still paint "#DIV/0!" (when the function do 0/number) and do you have an idea without range? 2015-01-13 11:46 GMT+02:00 Vaibhav Joshi : > Ohh.. i see...Try this n let me know... > > > Sub Test_4() > Dim i As Long > Dim countErr As Long > countErr = 0 > i = 2 > > On Error Resume Nex

Re: $$Excel-Macros$$ Do while loop question

2015-01-13 Thread Vaibhav Joshi
Ohh.. i see...Try this n let me know... Sub Test_4() Dim i As Long Dim countErr As Long countErr = 0 i = 2 On Error Resume Next For Each c In Range("H2:H6930") 'A2:H30 If c.Value > 0.18 And IsNumeric(c.Value) Then Range(Cells(c.Row, 1), Cells(c.Row, 8)).Interior.ColorIndex = 3 countErr = countEr

Re: $$Excel-Macros$$ Do while loop question

2015-01-13 Thread liron glam
Hi, it doesnt give me an error but it does paint the wrong number and it counts the cells and i need it to count the rows (it gives 648 errors of cells instead of 81 rows) 2015-01-13 7:07 GMT+02:00 Vaibhav Joshi : > try this > > Sub Test_4() > Dim i As Long > Dim countErr As Long > countErr =

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread Ashish Kumar
Nice Solution Vaibhav Sir. Regards Ashish On 13 January 2015 at 10:37, Vaibhav Joshi wrote: > try this > > Sub Test_4() > Dim i As Long > Dim countErr As Long > countErr = 0 > i = 2 > > On Error Resume Next > For Each c In Range("A3:H6930") 'A2:H30 > If c.Value > 0.18 And IsNumeric(c.Value)

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread Vaibhav Joshi
try this Sub Test_4() Dim i As Long Dim countErr As Long countErr = 0 i = 2 On Error Resume Next For Each c In Range("A3:H6930") 'A2:H30 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("te

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread liron glam
give debug :( thanks anyway 2015-01-12 17:23 GMT+02:00 Vaibhav Joshi : > 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 > c

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread Ashish Kumar
Nice Solution Vaibhav Sir. Regards Ashish On 12 January 2015 at 20:53, Vaibhav Joshi wrote: > 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).Inte

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread Vaibhav Joshi
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").Se

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread liron glam
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 : > what is your data range ? > > E.G. Your data range is B5:I100 then replace *A2:*H5 with the same.. > >

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread liron glam
my range is A3:H6930 2015-01-12 16:44 GMT+02:00 Vaibhav Joshi : > 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 > wrote: > >> it still doesnt wor

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread Vaibhav Joshi
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 wrote: > it still doesnt work, i need it to do the check only on the 8 column, > cause that's where the percents a

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread liron glam
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 : > Hi Liron > > try below code.. > > *Sub Test_4()* > *Dim i As Long* > *Dim countErr As Long* > *countErr = 0* > *i = 2* >

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread Ashish Kumar
Cheers Sir Cheers... On 12 January 2015 at 20:04, Vaibhav Joshi wrote: > Thanks Ashish !! > > Cheers!! > ᐧ > > On Mon, Jan 12, 2015 at 8:01 PM, Ashish Kumar > wrote: > >> Nice Solution Vaibhav Sir. >> >> >> Regards >> Ashish >> >> On 12 January 2015 at 19:57, Vaibhav Joshi wrote: >> >>> Hi

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread Vaibhav Joshi
Thanks Ashish !! Cheers!! ᐧ On Mon, Jan 12, 2015 at 8:01 PM, Ashish Kumar wrote: > Nice Solution Vaibhav Sir. > > > Regards > Ashish > > On 12 January 2015 at 19:57, Vaibhav Joshi wrote: > >> Hi Liron >> >> try below code.. >> >> *Sub Test_4()* >> *Dim i As Long* >> *Dim countErr As Long* >> *

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread Vaibhav Joshi
hi, yes c is instead of i. I have used range property to loop thru each cells in range, here c refers to cell (range with single cell) . you can also declare variable in the beginning Dim c As Range when you are using option explicit. Cheers!! ᐧ On Mon, Jan 12, 2015 at 8:00 PM, liron glam wro

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread Ashish Kumar
Nice Solution Vaibhav Sir. Regards Ashish On 12 January 2015 at 19:57, Vaibhav Joshi wrote: > 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") '< *If c.Value > 0.18 And IsNumeric(c.Value) Th

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread liron glam
Hi :) first of all thanks!, c is instead of i? 2015-01-12 16:27 GMT+02:00 Vaibhav Joshi : > 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") '< *If c.Value > 0.18 And IsNumeric(c.Value) Then* >

Re: $$Excel-Macros$$ Do while loop question

2015-01-12 Thread Vaibhav Joshi
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") '< 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

$$Excel-Macros$$ Do while loop question

2015-01-12 Thread liron glam
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, t