I hope you can help me - I'm at my wit's end.
I'm trying to put together a VBA Macro such that, when a user adds a row in a particular section of the sheet, which lists assets, that the macro adds a row to a couple to identical lists further down the same sheet and on a different sheet.
Basically, I want to turn:
1 Asset1
2 Asset2
3 Asset3
4 Asset4
5 Asset5
Into
1 Asset1
2 Asset2
3 Asset3
4 Asset4
5 Asset5
6 Asset6
but several times at once. It's also important that the extra rows have the same formulas in them as those around them.
To make things more complex, I have already written some code which applies to Rows 1 to 5, and I would like it to reference rows 1 to 6 when a user inserts a row - any idea how to do that? Can I make my cell references from these macros track the cells they refer to rather than the reference, when someone inserts a row? If not, how should I go about making a macro that writes a certain formula in a range if the cells the range and the cells referred to in the formula are dependent on how many rows have been added.
I'm trying to put together a VBA Macro such that, when a user adds a row in a particular section of the sheet, which lists assets, that the macro adds a row to a couple to identical lists further down the same sheet and on a different sheet.
Basically, I want to turn:
1 Asset1
2 Asset2
3 Asset3
4 Asset4
5 Asset5
Into
1 Asset1
2 Asset2
3 Asset3
4 Asset4
5 Asset5
6 Asset6
but several times at once. It's also important that the extra rows have the same formulas in them as those around them.
To make things more complex, I have already written some code which applies to Rows 1 to 5, and I would like it to reference rows 1 to 6 when a user inserts a row - any idea how to do that? Can I make my cell references from these macros track the cells they refer to rather than the reference, when someone inserts a row? If not, how should I go about making a macro that writes a certain formula in a range if the cells the range and the cells referred to in the formula are dependent on how many rows have been added.