Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to clear memory stored in the variables?
hi i was doing a loop and and would like to reset it back to i = 0 at the
beginning of each loop. what should i type at the end of each loop to reset the value? I tried i = 0, but it doesn't work. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to clear memory stored in the variables?
What is the full code for your loop?
"KiriumF1" wrote: hi i was doing a loop and and would like to reset it back to i = 0 at the beginning of each loop. what should i type at the end of each loop to reset the value? I tried i = 0, but it doesn't work. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to clear memory stored in the variables?
Would like to reset j,k,m,n,p,q,r back to 0, so that it will start from the
first column again. -------------- Sub sort_for_case1_test() d = 0 e = 1 ' For c = 0 To 11 Sheets("Datasheet2").Select Cells.Select Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("g2").Offset(0, c) _ , Order2:=xlDescending, Key3:=Range("D2"), Order3:=xlAscending, Header _ :=xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _ xlSortNormal j = k = m = n = p = q = r = 0 Do While e < 13 For i = 0 To 2427 If Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 92 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(2, 22).Offset(d, j) j = j + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 93 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(3, 22).Offset(d, k) k = k + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 94 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(4, 22).Offset(d, m) m = m + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 95 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(5, 22).Offset(d, n) n = n + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 96 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(6, 22).Offset(d, p) p = p + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 97 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(7, 22).Offset(d, q) q = q + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 98 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(8, 22).Offset(d, r) r = r + 4 End If Next i d = d + 8 e = e + 1 Loop ' Next c End Sub "gocush" wrote: What is the full code for your loop? "KiriumF1" wrote: hi i was doing a loop and and would like to reset it back to i = 0 at the beginning of each loop. what should i type at the end of each loop to reset the value? I tried i = 0, but it doesn't work. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to clear memory stored in the variables?
Hi,
j = k = m = n = p = q = r = 0 will not work. Write seperately for each variable. j=0 k=0 m=0 and so on. Sharad *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to clear memory stored in the variables?
j = 0: k = 0: m = 0: n = 0: p = 0: q = 0: r = 0
-- HTH RP (remove nothere from the email address if mailing direct) "KiriumF1" wrote in message ... Would like to reset j,k,m,n,p,q,r back to 0, so that it will start from the first column again. -------------- Sub sort_for_case1_test() d = 0 e = 1 ' For c = 0 To 11 Sheets("Datasheet2").Select Cells.Select Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("g2").Offset(0, c) _ , Order2:=xlDescending, Key3:=Range("D2"), Order3:=xlAscending, Header _ :=xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _ xlSortNormal j = k = m = n = p = q = r = 0 Do While e < 13 For i = 0 To 2427 If Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 92 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(2, 22).Offset(d, j) j = j + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 93 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(3, 22).Offset(d, k) k = k + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 94 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(4, 22).Offset(d, m) m = m + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 95 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(5, 22).Offset(d, n) n = n + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 96 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(6, 22).Offset(d, p) p = p + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 97 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(7, 22).Offset(d, q) q = q + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 98 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(8, 22).Offset(d, r) r = r + 4 End If Next i d = d + 8 e = e + 1 Loop ' Next c End Sub "gocush" wrote: What is the full code for your loop? "KiriumF1" wrote: hi i was doing a loop and and would like to reset it back to i = 0 at the beginning of each loop. what should i type at the end of each loop to reset the value? I tried i = 0, but it doesn't work. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to clear memory stored in the variables?
thanks!
"Bob Phillips" wrote: j = 0: k = 0: m = 0: n = 0: p = 0: q = 0: r = 0 -- HTH RP (remove nothere from the email address if mailing direct) "KiriumF1" wrote in message ... Would like to reset j,k,m,n,p,q,r back to 0, so that it will start from the first column again. -------------- Sub sort_for_case1_test() d = 0 e = 1 ' For c = 0 To 11 Sheets("Datasheet2").Select Cells.Select Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("g2").Offset(0, c) _ , Order2:=xlDescending, Key3:=Range("D2"), Order3:=xlAscending, Header _ :=xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _ xlSortNormal j = k = m = n = p = q = r = 0 Do While e < 13 For i = 0 To 2427 If Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 92 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(2, 22).Offset(d, j) j = j + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 93 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(3, 22).Offset(d, k) k = k + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 94 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(4, 22).Offset(d, m) m = m + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 95 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(5, 22).Offset(d, n) n = n + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 96 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(6, 22).Offset(d, p) p = p + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 97 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(7, 22).Offset(d, q) q = q + 4 ElseIf Cells(2, 2).Offset(i, 0).Value = e And Cells(2, 2).Offset(i, 2).Value = 98 Then Cells(2, 2).Offset(i, 0).Resize(1, 3).Copy _ Destination:=Cells(8, 22).Offset(d, r) r = r + 4 End If Next i d = d + 8 e = e + 1 Loop ' Next c End Sub "gocush" wrote: What is the full code for your loop? "KiriumF1" wrote: hi i was doing a loop and and would like to reset it back to i = 0 at the beginning of each loop. what should i type at the end of each loop to reset the value? I tried i = 0, but it doesn't work. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to clear memory stored in the variables?
thanks!
"Sharad" wrote: Hi, j = k = m = n = p = q = r = 0 will not work. Write seperately for each variable. j=0 k=0 m=0 and so on. Sharad *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to clear clipboard memory? | Excel Discussion (Misc queries) | |||
Clear formula memory? | Excel Discussion (Misc queries) | |||
Not at all clear on use of variables and/or object variables | Excel Discussion (Misc queries) | |||
Clear stored usernames | Excel Discussion (Misc queries) | |||
free up memory by deleting variables | Excel Programming |