![]() |
Commands for cursor moving right, left, up, down.
Hello, Sorry maybe for a basic question. Trying to make a macro within MS Excel (automatic VSB scripting), I get commands moving the cursor to a particular named cell instead of moving the cursor to the "right", left etc. Editing the macro, what are the commands just to let move the cursor to - right - left - up - down Ages ago I made some simple macro's in Lotus 123 in such a way the macro is repetaing itself by moving the cursor over the entire worksheet, to convert data from horizontal placement, to vertical placement. E.g. data of 7 coloms horizontal I want to change that the data is over 7 rows vertical. Next data of 7 coloms placed to the 7 next rows etc. When data is converted to 7 rows each in only one row, I want to save this as a text-file, so I get data in every single line. 7 lines contains the data of one "record". Next 7 lines data of the next record. What I want to do: - cursor moving one cel down - insert one row (6 times after each other) - cursor moving one cel right - cursor moving one cel up - cut the entire data - cursor moving one cel down - cursor moving one cel left - past the data in that particular cell - cursor moving one cel right (2 times after each other) - cursor moving one cel up - cut the entire data - cursor moving one cel down (2 times after each other) - cursor moving one cel left (2 times after each other) - cut the entire data - cursor moving one cel right (3 times after each other) - cursor moving one cel up (2 times after each other) - cut the entire data - cursor moving one cel down (3 times after each other) - cursor moving one cel left (3 times after each other) - cut the entire data etc. till all data of 7 rows is set to 7 lines - last line is cursor moving one cel down for the next "record" after that, the macro has to repeat till the complete worksheet is finished. -- Vr.groet - regards, Léon Obers |
Commands for cursor moving right, left, up, down.
Put the macro recorder on while you perform your sequence - Tools |
Macro | Record new Macro. You will be prompted for a name, and you can also specify where you want the macro to be located as well as setting up a keyboard shortcut. You will probably want to record in RELATIVE mode (click on the absolute/relative button to toggle). Hope this helps. Pete Leon Obers wrote: Hello, Sorry maybe for a basic question. Trying to make a macro within MS Excel (automatic VSB scripting), I get commands moving the cursor to a particular named cell instead of moving the cursor to the "right", left etc. Editing the macro, what are the commands just to let move the cursor to - right - left - up - down Ages ago I made some simple macro's in Lotus 123 in such a way the macro is repetaing itself by moving the cursor over the entire worksheet, to convert data from horizontal placement, to vertical placement. E.g. data of 7 coloms horizontal I want to change that the data is over 7 rows vertical. Next data of 7 coloms placed to the 7 next rows etc. When data is converted to 7 rows each in only one row, I want to save this as a text-file, so I get data in every single line. 7 lines contains the data of one "record". Next 7 lines data of the next record. What I want to do: - cursor moving one cel down - insert one row (6 times after each other) - cursor moving one cel right - cursor moving one cel up - cut the entire data - cursor moving one cel down - cursor moving one cel left - past the data in that particular cell - cursor moving one cel right (2 times after each other) - cursor moving one cel up - cut the entire data - cursor moving one cel down (2 times after each other) - cursor moving one cel left (2 times after each other) - cut the entire data - cursor moving one cel right (3 times after each other) - cursor moving one cel up (2 times after each other) - cut the entire data - cursor moving one cel down (3 times after each other) - cursor moving one cel left (3 times after each other) - cut the entire data etc. till all data of 7 rows is set to 7 lines - last line is cursor moving one cel down for the next "record" after that, the macro has to repeat till the complete worksheet is finished. -- Vr.groet - regards, Léon Obers |
Commands for cursor moving right, left, up, down.
Pete_UK wrote: Put the macro recorder on while you perform your sequence - Tools | Macro | Record new Macro. You will be prompted for a name, and you can also specify where you want the macro to be located as well as setting up a keyboard shortcut. As far, this is what I did before. But with the result of more or less absolute cell places (a named cell reference) within the macro instead of a "moving command" of the cursor itself. (Just want a moving command from each place the curser is set). You will probably want to record in RELATIVE mode (click on the absolute/relative button to toggle). Maybe that is the trick. But where to find absolute/relative button ? If it is only to have an absolute cell named data, the macro doesn't work for the entire spreadsheet, only for the first record. That is the trouble of having commands that use a cell code (name) instead of a "moving" command. The way Excel acts: Range("C10").Select "C10" is a fixed place within the macro. What I want is just a "moving" command to the right. So: When I set the curser at A1, the curser has to move to B1. When I set the curser at C28, the curser has to move to D28. Leon Obers wrote: Hello, Sorry maybe for a basic question. Trying to make a macro within MS Excel (automatic VSB scripting), I get commands moving the cursor to a particular named cell instead of moving the cursor to the "right", left etc. Editing the macro, what are the commands just to let move the cursor to - right - left - up - down Ages ago I made some simple macro's in Lotus 123 in such a way the macro is repetaing itself by moving the cursor over the entire worksheet, to convert data from horizontal placement, to vertical placement. E.g. data of 7 coloms horizontal I want to change that the data is over 7 rows vertical. Next data of 7 coloms placed to the 7 next rows etc. When data is converted to 7 rows each in only one row, I want to save this as a text-file, so I get data in every single line. 7 lines contains the data of one "record". Next 7 lines data of the next record. What I want to do: - cursor moving one cel down - insert one row (6 times after each other) - cursor moving one cel right - cursor moving one cel up - cut the entire data - cursor moving one cel down - cursor moving one cel left - past the data in that particular cell - cursor moving one cel right (2 times after each other) - cursor moving one cel up - cut the entire data - cursor moving one cel down (2 times after each other) - cursor moving one cel left (2 times after each other) - cut the entire data - cursor moving one cel right (3 times after each other) - cursor moving one cel up (2 times after each other) - cut the entire data - cursor moving one cel down (3 times after each other) - cursor moving one cel left (3 times after each other) - cut the entire data etc. till all data of 7 rows is set to 7 lines - last line is cursor moving one cel down for the next "record" after that, the macro has to repeat till the complete worksheet is finished. -- Vr.groet - regards, Léon Obers |
Commands for cursor moving right, left, up, down.
When you record a macro you get a small square in the middle of the
display - there is an icon to stop recording and another to toggle between absolute and relative. By default, this starts in absolute mode, so you should click it once before making any keystrokes. It is not the best design of icon, but if you look carefully you can just about make out the difference between it being pressed and un-pressed. Hope this helps. Pete Leon Obers wrote: Pete_UK wrote: Put the macro recorder on while you perform your sequence - Tools | Macro | Record new Macro. You will be prompted for a name, and you can also specify where you want the macro to be located as well as setting up a keyboard shortcut. As far, this is what I did before. But with the result of more or less absolute cell places (a named cell reference) within the macro instead of a "moving command" of the cursor itself. (Just want a moving command from each place the curser is set). You will probably want to record in RELATIVE mode (click on the absolute/relative button to toggle). Maybe that is the trick. But where to find absolute/relative button ? If it is only to have an absolute cell named data, the macro doesn't work for the entire spreadsheet, only for the first record. That is the trouble of having commands that use a cell code (name) instead of a "moving" command. The way Excel acts: Range("C10").Select "C10" is a fixed place within the macro. What I want is just a "moving" command to the right. So: When I set the curser at A1, the curser has to move to B1. When I set the curser at C28, the curser has to move to D28. Leon Obers wrote: Hello, Sorry maybe for a basic question. Trying to make a macro within MS Excel (automatic VSB scripting), I get commands moving the cursor to a particular named cell instead of moving the cursor to the "right", left etc. Editing the macro, what are the commands just to let move the cursor to - right - left - up - down Ages ago I made some simple macro's in Lotus 123 in such a way the macro is repetaing itself by moving the cursor over the entire worksheet, to convert data from horizontal placement, to vertical placement. E.g. data of 7 coloms horizontal I want to change that the data is over 7 rows vertical. Next data of 7 coloms placed to the 7 next rows etc. When data is converted to 7 rows each in only one row, I want to save this as a text-file, so I get data in every single line. 7 lines contains the data of one "record". Next 7 lines data of the next record. What I want to do: - cursor moving one cel down - insert one row (6 times after each other) - cursor moving one cel right - cursor moving one cel up - cut the entire data - cursor moving one cel down - cursor moving one cel left - past the data in that particular cell - cursor moving one cel right (2 times after each other) - cursor moving one cel up - cut the entire data - cursor moving one cel down (2 times after each other) - cursor moving one cel left (2 times after each other) - cut the entire data - cursor moving one cel right (3 times after each other) - cursor moving one cel up (2 times after each other) - cut the entire data - cursor moving one cel down (3 times after each other) - cursor moving one cel left (3 times after each other) - cut the entire data etc. till all data of 7 rows is set to 7 lines - last line is cursor moving one cel down for the next "record" after that, the macro has to repeat till the complete worksheet is finished. -- Vr.groet - regards, Léon Obers |
Commands for cursor moving right, left, up, down.
Pete wrote: When you record a macro you get a small square in the middle of the display - there is an icon to stop recording and another to toggle between absolute and relative. By default, this starts in absolute mode, so you should click it once before making any keystrokes. Thanks, great, this works. But now. To avoid several hand mader starts of the macro I want to edit the macro in a loop. I am not familiar with VSB but do have some experiance with other dataase languages. What is the exact way / commands to write down (edit) the macro? Someting like this. Start loop; if n < 401 n = n+1 {move, cut, move, past macro as found earlier above} end loop -- Vr.groet - regards, Léon Obers |
All times are GMT +1. The time now is 06:11 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com