ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro to Reset data input form (https://www.excelbanter.com/excel-worksheet-functions/242838-macro-reset-data-input-form.html)

MichaelRobert

Macro to Reset data input form
 
I have a worksheet set up as a data entry page to allow customers to select
features in a product. This data then generates a part number to capture that
particular set of features.

However, this leaves me with the Data Input form populated with the last
customer's selections. How can I write my macro to Reset the form to the
'blank' starting position? I envision having a 'Reset' box in the worksheet
to cue the Macro.

Thanks.

Mike


Paul C

Macro to Reset data input form
 
Write the start of your macro first on a module sheet. You can write the
whole thing or start with one line and add additional lines later.

Sub Resetform()
Range("A1").ClearContents
......
(add cells as needed)
End Sub

Using ClearContents will leave formatting and validations intact

Make the reset box a Form Control command button and link it to this macro.
--
If this helps, please remember to click yes.


"MichaelRobert" wrote:

I have a worksheet set up as a data entry page to allow customers to select
features in a product. This data then generates a part number to capture that
particular set of features.

However, this leaves me with the Data Input form populated with the last
customer's selections. How can I write my macro to Reset the form to the
'blank' starting position? I envision having a 'Reset' box in the worksheet
to cue the Macro.

Thanks.

Mike


MichaelRobert

Macro to Reset data input form
 
Many thanks, Paul C.

Mike

"Paul C" wrote:

Write the start of your macro first on a module sheet. You can write the
whole thing or start with one line and add additional lines later.

Sub Resetform()
Range("A1").ClearContents
.....
(add cells as needed)
End Sub

Using ClearContents will leave formatting and validations intact

Make the reset box a Form Control command button and link it to this macro.
--
If this helps, please remember to click yes.


"MichaelRobert" wrote:

I have a worksheet set up as a data entry page to allow customers to select
features in a product. This data then generates a part number to capture that
particular set of features.

However, this leaves me with the Data Input form populated with the last
customer's selections. How can I write my macro to Reset the form to the
'blank' starting position? I envision having a 'Reset' box in the worksheet
to cue the Macro.

Thanks.

Mike


MichaelRobert

Macro to Reset data input form
 
The ClearContents command works fine in clearing the form. But ideally the
result of the 'Reset' will be to populate each of the cleared cells (Range
b9:c15) with the word 'Empty'.

Is their a command to specify the content of cells?

Thanks.

Mike

"MichaelRobert" wrote:

Many thanks, Paul C.

Mike

"Paul C" wrote:

Write the start of your macro first on a module sheet. You can write the
whole thing or start with one line and add additional lines later.

Sub Resetform()
Range("A1").ClearContents
.....
(add cells as needed)
End Sub

Using ClearContents will leave formatting and validations intact

Make the reset box a Form Control command button and link it to this macro.
--
If this helps, please remember to click yes.


"MichaelRobert" wrote:

I have a worksheet set up as a data entry page to allow customers to select
features in a product. This data then generates a part number to capture that
particular set of features.

However, this leaves me with the Data Input form populated with the last
customer's selections. How can I write my macro to Reset the form to the
'blank' starting position? I envision having a 'Reset' box in the worksheet
to cue the Macro.

Thanks.

Mike


Dave Peterson

Macro to Reset data input form
 
Maybe...

worksheets("Sheet99999").range("b9:c15").value = "Empty"



MichaelRobert wrote:

The ClearContents command works fine in clearing the form. But ideally the
result of the 'Reset' will be to populate each of the cleared cells (Range
b9:c15) with the word 'Empty'.

Is their a command to specify the content of cells?

Thanks.

Mike

"MichaelRobert" wrote:

Many thanks, Paul C.

Mike

"Paul C" wrote:

Write the start of your macro first on a module sheet. You can write the
whole thing or start with one line and add additional lines later.

Sub Resetform()
Range("A1").ClearContents
.....
(add cells as needed)
End Sub

Using ClearContents will leave formatting and validations intact

Make the reset box a Form Control command button and link it to this macro.
--
If this helps, please remember to click yes.


"MichaelRobert" wrote:

I have a worksheet set up as a data entry page to allow customers to select
features in a product. This data then generates a part number to capture that
particular set of features.

However, this leaves me with the Data Input form populated with the last
customer's selections. How can I write my macro to Reset the form to the
'blank' starting position? I envision having a 'Reset' box in the worksheet
to cue the Macro.

Thanks.

Mike


--

Dave Peterson

MichaelRobert

Macro to Reset data input form
 
Thanks, Dave. Works like a charm!

Mike
"Dave Peterson" wrote:

Maybe...

worksheets("Sheet99999").range("b9:c15").value = "Empty"



MichaelRobert wrote:

The ClearContents command works fine in clearing the form. But ideally the
result of the 'Reset' will be to populate each of the cleared cells (Range
b9:c15) with the word 'Empty'.

Is their a command to specify the content of cells?

Thanks.

Mike

"MichaelRobert" wrote:

Many thanks, Paul C.

Mike

"Paul C" wrote:

Write the start of your macro first on a module sheet. You can write the
whole thing or start with one line and add additional lines later.

Sub Resetform()
Range("A1").ClearContents
.....
(add cells as needed)
End Sub

Using ClearContents will leave formatting and validations intact

Make the reset box a Form Control command button and link it to this macro.
--
If this helps, please remember to click yes.


"MichaelRobert" wrote:

I have a worksheet set up as a data entry page to allow customers to select
features in a product. This data then generates a part number to capture that
particular set of features.

However, this leaves me with the Data Input form populated with the last
customer's selections. How can I write my macro to Reset the form to the
'blank' starting position? I envision having a 'Reset' box in the worksheet
to cue the Macro.

Thanks.

Mike


--

Dave Peterson



All times are GMT +1. The time now is 12:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com