Hi
Please show me how to modify the following macro so that the rows inserted in that column are selected and the OPTION BOX to format as above, below or clear formatting is shown.
Thanks!
Please Login or Register to view this content.
Hi
Please show me how to modify the following macro so that the rows inserted in that column are selected and the OPTION BOX to format as above, below or clear formatting is shown.
Thanks!
Please Login or Register to view this content.
Here's one way
Please Login or Register to view this content.
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
That neither selects inserted rows nor presents the formatting option box.
See the difference between running the macro, and inserting the rows by the menu commands.
Your original macro didn't select cells and neither does mine. They both USE what happens to be selected when you run the macro, the only difference is your macro accepts a range of cells and then you use a loop to process the cells. A loop is not necessary since you're specifying the number of rows to insert. Hence I simplified and removed the loop (loops should always be avoided if possible since they are not efficient in terms of overhead time when large ranges are involved).
Neither am I clear what you mean by the formatting option box. It's standard Excel functionality to carry the formatting on the selected row to rows you introduce. Or it is on Excel 2007 --->
Maybe it's because you apparently have Excel 2002. In which case try adding the copyorigin instruction.
Please Login or Register to view this content.
The formatting option box is the brush icon that appears in one of the above pictures.
May I have a choice by means of a drop down to choose the CopyOrigin?
edit: and modify in order to select inserted rows?
Hi,
Maybe
Please Login or Register to view this content.
A,a,B,b inserts row BELOW selection and formats as BELOW. It should insert row above selection and then if A,a format as above, if B,b format as below.
C,c inserts row BELOW selection and clears formatting. It should insert row above selection and clear formatting.
Inserted rows still are not selected after macro end.
This works ok.
The function of selecting the inserted rows on macro end is still wanted.
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks