jigglypuff
New Member
- Joined
- Mar 28, 2013
- Messages
- 25
Hi guys, I am using a code that's making my Excel run slower than a turtle, is there a problem with its length or is it because all the codes are working with the same column at the same time? Can anyone help me ? Here is the code I'm talking about:
If Cells(Target.Row, 1).Value >= 40909 And Cells(Target.Row, 1).Value <= 40939 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$56)*1000)"
If Cells(Target.Row, 1).Value > 40939 And Cells(Target.Row, 1).Value <= 40968 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$57)*1000)"
If Cells(Target.Row, 1).Value > 40968 And Cells(Target.Row, 1).Value <= 40999 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$58)*1000)"
If Cells(Target.Row, 1).Value > 40999 And Cells(Target.Row, 1).Value <= 41029 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$59)*1000)"
If Cells(Target.Row, 1).Value > 41029 And Cells(Target.Row, 1).Value <= 41060 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$60)*1000)"
If Cells(Target.Row, 1).Value > 41060 And Cells(Target.Row, 1).Value <= 41090 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$61)*1000)"
If Cells(Target.Row, 1).Value > 41090 And Cells(Target.Row, 1).Value <= 41121 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$62)*1000)"
If Cells(Target.Row, 1).Value > 41121 And Cells(Target.Row, 1).Value <= 41152 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$63)*1000)"
If Cells(Target.Row, 1).Value > 41152 And Cells(Target.Row, 1).Value <= 41182 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$64)*1000)"
If Cells(Target.Row, 1).Value > 41182 And Cells(Target.Row, 1).Value <= 41213 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$65)*1000)"
If Cells(Target.Row, 1).Value > 41213 And Cells(Target.Row, 1).Value <= 41243 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$66)*1000)"
If Cells(Target.Row, 1).Value > 41243 And Cells(Target.Row, 1).Value <= 41274 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$67)*1000)"
'2013'
If Cells(Target.Row, 1).Value > 41274 And Cells(Target.Row, 1).Value <= 41305 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$39)*1000)"
If Cells(Target.Row, 1).Value > 41305 And Cells(Target.Row, 1).Value <= 41333 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$40)*1000)"
If Cells(Target.Row, 1).Value > 41333 And Cells(Target.Row, 1).Value <= 41364 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$41)*1000)"
If Cells(Target.Row, 1).Value > 41364 And Cells(Target.Row, 1).Value <= 41394 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$42)*1000)"
If Cells(Target.Row, 1).Value > 41394 And Cells(Target.Row, 1).Value <= 41425 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$43)*1000)"
If Cells(Target.Row, 1).Value > 41425 And Cells(Target.Row, 1).Value <= 41455 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$44)*1000)"
If Cells(Target.Row, 1).Value > 41455 And Cells(Target.Row, 1).Value <= 41486 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$45)*1000)"
If Cells(Target.Row, 1).Value > 41486 And Cells(Target.Row, 1).Value <= 41517 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$46)*1000)"
If Cells(Target.Row, 1).Value > 41517 And Cells(Target.Row, 1).Value <= 41547 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$47)*1000)"
If Cells(Target.Row, 1).Value > 41547 And Cells(Target.Row, 1).Value <= 41578 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$48)*1000)"
If Cells(Target.Row, 1).Value > 41578 And Cells(Target.Row, 1).Value <= 41608 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$49)*1000)"
If Cells(Target.Row, 1).Value > 41608 And Cells(Target.Row, 1).Value <= 41639 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$50)*1000)"
Thank you in advance!
If Cells(Target.Row, 1).Value >= 40909 And Cells(Target.Row, 1).Value <= 40939 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$56)*1000)"
If Cells(Target.Row, 1).Value > 40939 And Cells(Target.Row, 1).Value <= 40968 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$57)*1000)"
If Cells(Target.Row, 1).Value > 40968 And Cells(Target.Row, 1).Value <= 40999 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$58)*1000)"
If Cells(Target.Row, 1).Value > 40999 And Cells(Target.Row, 1).Value <= 41029 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$59)*1000)"
If Cells(Target.Row, 1).Value > 41029 And Cells(Target.Row, 1).Value <= 41060 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$60)*1000)"
If Cells(Target.Row, 1).Value > 41060 And Cells(Target.Row, 1).Value <= 41090 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$61)*1000)"
If Cells(Target.Row, 1).Value > 41090 And Cells(Target.Row, 1).Value <= 41121 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$62)*1000)"
If Cells(Target.Row, 1).Value > 41121 And Cells(Target.Row, 1).Value <= 41152 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$63)*1000)"
If Cells(Target.Row, 1).Value > 41152 And Cells(Target.Row, 1).Value <= 41182 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$64)*1000)"
If Cells(Target.Row, 1).Value > 41182 And Cells(Target.Row, 1).Value <= 41213 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$65)*1000)"
If Cells(Target.Row, 1).Value > 41213 And Cells(Target.Row, 1).Value <= 41243 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$66)*1000)"
If Cells(Target.Row, 1).Value > 41243 And Cells(Target.Row, 1).Value <= 41274 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$67)*1000)"
'2013'
If Cells(Target.Row, 1).Value > 41274 And Cells(Target.Row, 1).Value <= 41305 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$39)*1000)"
If Cells(Target.Row, 1).Value > 41305 And Cells(Target.Row, 1).Value <= 41333 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$40)*1000)"
If Cells(Target.Row, 1).Value > 41333 And Cells(Target.Row, 1).Value <= 41364 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$41)*1000)"
If Cells(Target.Row, 1).Value > 41364 And Cells(Target.Row, 1).Value <= 41394 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$42)*1000)"
If Cells(Target.Row, 1).Value > 41394 And Cells(Target.Row, 1).Value <= 41425 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$43)*1000)"
If Cells(Target.Row, 1).Value > 41425 And Cells(Target.Row, 1).Value <= 41455 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$44)*1000)"
If Cells(Target.Row, 1).Value > 41455 And Cells(Target.Row, 1).Value <= 41486 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$45)*1000)"
If Cells(Target.Row, 1).Value > 41486 And Cells(Target.Row, 1).Value <= 41517 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$46)*1000)"
If Cells(Target.Row, 1).Value > 41517 And Cells(Target.Row, 1).Value <= 41547 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$47)*1000)"
If Cells(Target.Row, 1).Value > 41547 And Cells(Target.Row, 1).Value <= 41578 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$48)*1000)"
If Cells(Target.Row, 1).Value > 41578 And Cells(Target.Row, 1).Value <= 41608 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$49)*1000)"
If Cells(Target.Row, 1).Value > 41608 And Cells(Target.Row, 1).Value <= 41639 Then Cells(Target.Row, 4).Formula = "=if(C:C="""","""",(C:C/Sheet1!$U$50)*1000)"
Thank you in advance!