Visual Basic code inversion

Z

Zakynthos

Is there a piece of code I can input to a visual basic macro that will enable
it to execute in reverse order? In other words, if line 1 of the code was
Sendkeys "C1" and line 500 or whatever was Sendkeys "{TAB}", I would want it
to run from line 500 to line 1.

This will allow me to fix a small 'glitch' in which the first bloc of code
in a series of macros always runs in reverse order when run with other
macros, when run alone it runs correctly.

Many thanks
 
J

Jezebel

Copy the lines of code and paste into a column in a worksheet.
Number the rows
Sort by the row number descending
Copy back to the macro


Seems an insane way to write macros, but whatever floats your boat.
 
Z

Zakynthos

Many thanks for your advice.

Best wishes

Tony

Jezebel said:
Copy the lines of code and paste into a column in a worksheet.
Number the rows
Sort by the row number descending
Copy back to the macro


Seems an insane way to write macros, but whatever floats your boat.
 
B

Bill Martin

Zakynthos said:
Is there a piece of code I can input to a visual basic macro that will enable
it to execute in reverse order? In other words, if line 1 of the code was
Sendkeys "C1" and line 500 or whatever was Sendkeys "{TAB}", I would want it
to run from line 500 to line 1.

This will allow me to fix a small 'glitch' in which the first bloc of code
in a series of macros always runs in reverse order when run with other
macros, when run alone it runs correctly.

Many thanks

-----------------------

Sounds to me like you'd be further ahead to figure out what's causing your
bizzare glitch and fix the intrinsic problem -- rather than patching around it
like this.

Good luck...

Bill
 
Z

Zakynthos

Bill,

Thanks, I've already come to the same conclusion and I'm on the case.

Regards,

Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top