ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to copy, edit then paste a macro. (https://www.excelbanter.com/excel-worksheet-functions/242034-how-copy-edit-then-paste-macro.html)

Romileyrunner1

How to copy, edit then paste a macro.
 
Hi,
I have a worksheet which needs lots of macros.
All the macros are very similar.
They need to turn off the protection, highlight the full spreadsheet (which
is very big and not easy to do accurately first time), sort on a particular
collumn, then turn back on the protection.
The only real difference is the collumn to be sorted on and then the
finishing range of cells in view (I want it to be central in view to the
collumn that has just been sorted: not right back on the far left so you have
to scroll back again).

So, having recorded 1 macro, how can I copy, edit and paste this and rename
to become the next one I need etc. (these are all going to be activated by
buttons on top of each relavent collumn).

Many thanks.
RR1

Pete_UK

How to copy, edit then paste a macro.
 
Can't you just have one macro into which you pass a parameter which is
the column to be sorted? Presumably you want to show that column in
the centre of the screen, so that the scrolling you do after sorting
is also dependent on the column number.

Post your macro here and I'm sure someone will be able to help
further.

Hope this helps.

Pete

On Sep 8, 8:48*pm, Romileyrunner1
wrote:
Hi,
I have a worksheet which needs lots of macros.
All the macros are very similar.
They need to turn off the protection, highlight the full spreadsheet (which
is very big and not easy to do accurately first time), sort on a particular
collumn, then turn back on the protection.
The only real difference is the collumn to be sorted on and then the
finishing range of cells in view (I want it to be central in view to the
collumn that has just been sorted: not right back on the far left so you have
to scroll back again).

So, having recorded 1 macro, how can I copy, edit and paste this and rename
to become the next one I need etc. (these are all going to be activated by
buttons on top of each relavent collumn).

Many thanks. *
RR1




All times are GMT +1. The time now is 03:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com