I don't even know if this is possible, but bare with me and please let me know if it is:
I am working on a form that I may need to insert rows to duplicate the same form (I have a lot of other sheets, so duplicating sheets is not an option). For example, I would have a form with information form A1 to C10. I would then have a macro that can insert 10 rows with the same information from A1 to C10. That is not the problem.
Currently, within the form, I have a hide row and show row macro. E.g.,
This would be linked to 2 buttons that will automatically hide/show the row when clicked upon.
Is there anyway that the form and buttons with the hide/show row can be duplicated upon execution of another macro? In essence, there needs to be new rows inserted, the form pasted, and the buttons reproduced but referencing the correct rows to show/hide. There's no such thing as a relative reference for this, correct?
The end result would be a macro that from A1 to C10, can insert 10 rows, and have a new A1 to C10, the original A1 to C10 form would be displaced to A11 to C20, and all the show/hide macros would work. Then if another form needs to be created, 10 more rows inserted from the macro, and so forth.
Sorry for the lengthy explanation. Any help would be much appreciated. Thanks!
I am working on a form that I may need to insert rows to duplicate the same form (I have a lot of other sheets, so duplicating sheets is not an option). For example, I would have a form with information form A1 to C10. I would then have a macro that can insert 10 rows with the same information from A1 to C10. That is not the problem.
Currently, within the form, I have a hide row and show row macro. E.g.,
Code:
Sub Hide()
Rows("3:5").Select
Selection.EntireRow.Hidden = True
End Sub
Sub Show()
Rows("2:6").Select
Selection.EntireRow.Hidden = False
End Sub
Is there anyway that the form and buttons with the hide/show row can be duplicated upon execution of another macro? In essence, there needs to be new rows inserted, the form pasted, and the buttons reproduced but referencing the correct rows to show/hide. There's no such thing as a relative reference for this, correct?
The end result would be a macro that from A1 to C10, can insert 10 rows, and have a new A1 to C10, the original A1 to C10 form would be displaced to A11 to C20, and all the show/hide macros would work. Then if another form needs to be created, 10 more rows inserted from the macro, and so forth.
Sorry for the lengthy explanation. Any help would be much appreciated. Thanks!