C
Carl Rapson
I have a workbook that I use as a template for users. I open the worksheet
in read-only mode (from an Access form), and allow the users to enter their
data. When they are finished, they click a command button to save the data
to an Access database. They can also save the worksheet to a new file name,
but can't overwrite the template file.
My problem is, in certain circumstances I would like to "clear" the
workbook, resetting all cells to their original contents. This would take
place in VBA code, when the user clicks a command button. Is there an easy
way to do this? I have looked at the Application and Workbook objects, but I
can't see any way to tell the workbook to "reset" itself. I thought about
just iterating through the cells in the workbook, doing a ClearContents on
each, but it is possible that the user has added some rows to the workbook
and I want to be sure to remove those rows as well.
Is there a good way to do this? Thanks for any information,
Carl Rapson
in read-only mode (from an Access form), and allow the users to enter their
data. When they are finished, they click a command button to save the data
to an Access database. They can also save the worksheet to a new file name,
but can't overwrite the template file.
My problem is, in certain circumstances I would like to "clear" the
workbook, resetting all cells to their original contents. This would take
place in VBA code, when the user clicks a command button. Is there an easy
way to do this? I have looked at the Application and Workbook objects, but I
can't see any way to tell the workbook to "reset" itself. I thought about
just iterating through the cells in the workbook, doing a ClearContents on
each, but it is possible that the user has added some rows to the workbook
and I want to be sure to remove those rows as well.
Is there a good way to do this? Thanks for any information,
Carl Rapson