formatting a row automaticaly when inserted.

dusty

Registered User.
Local time
Yesterday, 22:43
Joined
Aug 20, 2009
Messages
42
I have a table in excel which people can add too. When they add to the table they inesrt new rows in the relevant section.

It would be nice to have code in place that when a new row is inserted specific cells are merged in that row rather than the user having to merge them themselves.

Is this possible?

The cells to merge would be columns (C,D,E) and columns (I,J,K)

Cheers Dusty
 
There are a number of ways of doing this by recording macros, have you tried it? One idea:

1) You could record a macro to insert a new row from whereever the mouse happens to be and then merge the cells you require.

When recording the macro, you could add a new row in your table, and then use the 'down' arrow key to navigate down to the new row to do the formatting you require (don't click on the row below!).

Once the macro works, you might be able to add a button to your sheet.
 
I don't think I was clear enough in my original post. I understand how to do it by using a command button and then say adding a row at the end of the table or end of a specific section.

But there are 7 sections so would mean seven buttons.

At the moment the user will right click on the left toolbar and select insert to insert a new row in the desired position. What I want to know is how to hack into the code behind this procedure and specify the cells to be merged.

At the moment the only way i can think of doing this is under the private sub worksheet_change running code that merges row by row the desired columns but this is not efficient at all.
 

Users who are viewing this thread

Back
Top Bottom