I have a table that I want a specific column to be changed. The table can be from 25 to 2500 rows. I need to run my macro and then have it repeat X number of times, which I need to be able to input. If I have 138 rows, I need to be able to tell it to run only 138 times. I have no problems with getting the macro to do what I need to one row, it's all the following rows that I'm having trouble with. I don't understand the Repeat/Until function very well, so VERY specific code would be appreciated.
Thanks in advance...
Repeat
Moderators: Dorian (MJT support), JRL
//Sets the message box size...
Let>MSG_HEIGHT=120
Let>MSG_WIDTH=500
//Repeat a variable....the variable could be k or s or anything you like, however we set the variable to equal 0
Let>k=0
Repeat>k
//Do something, in your case put here the code that allows you do do something once.
//Example, poke something into an Excel spreadsheet.
//Example increase to the next line in a file etc...
Let>Freds_age=k
//So we are going to say that Freds age is 0 to start with.
//Now send a message to screen saying Fred is %k% and getting older.
Message>Fred is %k% years old and will keep going untill he is 138
wait>.1
// So now your code has run once.
// So now increase the variable by 1....
Let>k=k+1
// now the script is going to jump back to Repeat>k at the top with a new value of k+1 untill it reaches 138
Until>k=139
//So now we confirm we have moved on.
MessageModal>Fred has got to %k% and is ready to do something else now.
End
Let>MSG_HEIGHT=120
Let>MSG_WIDTH=500
//Repeat a variable....the variable could be k or s or anything you like, however we set the variable to equal 0
Let>k=0
Repeat>k
//Do something, in your case put here the code that allows you do do something once.
//Example, poke something into an Excel spreadsheet.
//Example increase to the next line in a file etc...
Let>Freds_age=k
//So we are going to say that Freds age is 0 to start with.
//Now send a message to screen saying Fred is %k% and getting older.
Message>Fred is %k% years old and will keep going untill he is 138
wait>.1
// So now your code has run once.
// So now increase the variable by 1....
Let>k=k+1
// now the script is going to jump back to Repeat>k at the top with a new value of k+1 untill it reaches 138
Until>k=139
//So now we confirm we have moved on.
MessageModal>Fred has got to %k% and is ready to do something else now.
End
Phil.......