NeVeR Posted February 5, 2013 Report Share Posted February 5, 2013 I've a list of numbers that i'd like to copy. Each number is on it's own line in a spread sheet. I'd like each number once copied to be give a %T1% and then %T2% for the second and so on. So each number has it's own %T% number. The list of numbers i've to copy changes all the time. So when i start the marco i'd like to get a prompt saying "How many times to repeat" I'd enter a value and then the macro would know how many times to run. I'm sure I can get this part done ( I hope ) It's the setting each copied number to it's own %T% that i can't figure out. I know i could do this the long way of just duplicating a command 10 or 20 times in ME and then repeating it by hand .. but i don't really want to as i'm sure there is a way around it. Any idea ? What i have so far is Set Var Interger %N!% from prompt // I will enter the repeat amounts here Repeat with Var using N1 / repeat will start. Clipboard copy Var set string %T!% from clipboard -------------- How do i get this part to move to %T2% and then %T3% etc each new time the repeat is run ? there is more to it but this is the main part i'm stuck on. thanks. Quote Link to comment Share on other sites More sharing options...
NeVeR Posted February 5, 2013 Author Report Share Posted February 5, 2013 Sorry i should add that after the macro has run fully.. and worked it should have from 30-40 saved numbers... How do i get them to paste out ? will i just have to set individual commands to paste each T number one at a time ? Quote Link to comment Share on other sites More sharing options...
Samrae Posted February 5, 2013 Report Share Posted February 5, 2013 There is an example of using a integer variable to index string variables in the Variable Evaluation Level article in the July 2005 issue of the Macro Express News email newsletter. That article refers to a Variable Evaluation Level sample macro. I think it says to use something like %T%N1%% but you may have to change the Variables Evaluation Level setting from 0 to 1 in the preferences. To get there open preferences, click Miscellaneous and then the Advanced button. Quote Link to comment Share on other sites More sharing options...
acantor Posted February 24, 2013 Report Share Posted February 24, 2013 Set Var Integer %N1% from prompt // I will enter the repeat amounts here Set Var Integer %N99% = 1 // This is the counter Repeat %N1% times Clipboard copy Var set string %T%N99%% from clipboard // Example: When %N99% = 1, the value of %T%N99%% is %T1% %N99% = %N99% + 1 // Increment by 1 End Repeat // To paste out the values: Set Var Integer %N99% = 1 // Reset the counter to 1 Repeat %N1% times Type Text %T%N99%% // Move the cursor to the next location, e.g., Type Text <TAB> , Type Text <ENTER>, or whatever %N99% = %N99% + 1 End Repeat Quote Link to comment Share on other sites More sharing options...
brad6499 Posted May 15, 2014 Report Share Posted May 15, 2014 I have been trying to do EXACTLY this, without success. Where would I paste your code in MacroExpress? Set Var Integer %N1% from prompt // I will enter the repeat amounts here Set Var Integer %N99% = 1 // This is the counter Repeat %N1% times Clipboard copy Var set string %T%N99%% from clipboard // Example: When %N99% = 1, the value of %T%N99%% is %T1% %N99% = %N99% + 1 // Increment by 1 End Repeat The only option I can seem to find is 'Variable Set String' - however it forces you to pick from a dropdown list of T variables. Just need help how to get this command working: Var set string %T%N99%% from clipboard Thank you! Quote Link to comment Share on other sites More sharing options...
acantor Posted May 16, 2014 Report Share Posted May 16, 2014 My bad! The code sample I provided was based on what can be done with Macro Express Pro! Quote Link to comment Share on other sites More sharing options...
brad6499 Posted May 16, 2014 Report Share Posted May 16, 2014 Great reason to upgrade then! Just bought Macro Express Pro. However, my variables now show up like this: %T[99]% (note the brackets) whereas in MEX3 it would've appeared as %T99%. Is the bracketing required? I don't see it in your code: Var set string %T%N99%% from clipboard If not required, curious why all of my variables now have it when opened in MEXPro. Thanks [uPDATE: I figured it out. The brackets were required. Guessing either the brackets were added after your original post date, or you excluded them for clarity reasons. Either way, this post was very helpful so thanks!] Quote Link to comment Share on other sites More sharing options...
acantor Posted May 19, 2014 Report Share Posted May 19, 2014 In MEP, you are not restricted to variable names like %N1,% %T1%, etc. You can use %Count%, %Height%, and whatever. It's a nice option. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.