Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Aubrey Schmidt   on Aug 27 In MS Office Category.

  
Question Answered By: Eloise Lawrence   on Aug 27

I'm not sure I understand exactly what you want, but I'll try to help  you.

For starters, you seem to want a For loop running backwards (from 7 to
4, instead of from 4 to 7) if this is right, you shold use "For i = 7
to 4 step -1", where the "step -1" part will make it go backwards.

Secondly, the assignation line could be better like this:
Cells(9,2)=Cells(iMyRow-1,4)

The first number within Cells() is the row, and the second is the colmn.

I'm not sure why would you want the loop to start in 7 and use a "-1"
to get the 6, so I set  the loop to start in 6. If I understood what
you want to achieve, the code  should work  like this:

Dim iMyRow as integer

For iMiRow = 7 to 4 step -1
Cells(9,2)=Cells(iMyRow,4)
Next

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on VB Code Corrected Solutions Or get search suggestion and latest updates.


Tagged: