Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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
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
How to clear clipboard memory? Eric Excel Discussion (Misc queries) 2 April 6th 10 06:09 PM
Clear formula memory? Matt Williamson[_2_] Excel Discussion (Misc queries) 2 June 2nd 09 07:08 PM
Not at all clear on use of variables and/or object variables JMay-Rke Excel Discussion (Misc queries) 11 July 4th 08 06:36 PM
Clear stored usernames Brent E Excel Discussion (Misc queries) 1 November 23rd 05 11:37 PM
free up memory by deleting variables clui[_11_] Excel Programming 4 December 11th 03 01:10 AM


All times are GMT +1. The time now is 01:46 AM.

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"