Macro Help

  • Thread starter Thread starter old123
  • Start date Start date
O

old123

In Excel 2002, I have a template that calculates total footage of a uni
of lumber. In that template, after user enters the required data,
have a macro that is attached to a button that prints the page. What
want to have this macro to do is to ask the question "Do you wish t
enter another tally? (Y/N)" - if the answer is "Y" or "y", clear th
entered data, go to the first cell that requires data entry, then end.
If the answer is "N" or "n", close the worksheet.

I have done this in Lotus/123 using the GETLABEL and BRANCH macr
commands, but I can't find/can't see or am just not understanding ho
to do this in Excel. Any help and guidance would be appreciated!!
 
This may get you started:

Sub Test()
If MsgBox("Do you wish to enter another tally?", _
vbQuestion + vbYesNo) = vbYes Then
Range("A1,A3,A10").ClearContents
Range("A1").Select
Else
ActiveWorkbook.Close False
End If
End Sub


--
Jim Rech
Excel MVP
| In Excel 2002, I have a template that calculates total footage of a unit
| of lumber. In that template, after user enters the required data, I
| have a macro that is attached to a button that prints the page. What I
| want to have this macro to do is to ask the question "Do you wish to
| enter another tally? (Y/N)" - if the answer is "Y" or "y", clear the
| entered data, go to the first cell that requires data entry, then end.
| If the answer is "N" or "n", close the worksheet.
|
| I have done this in Lotus/123 using the GETLABEL and BRANCH macro
| commands, but I can't find/can't see or am just not understanding how
| to do this in Excel. Any help and guidance would be appreciated!!!
|
|
| ---
| Message posted
|
 
Attached is the file/template. I want to add the code to the end of th
PRNT macro - to be attached to a PRINT button.

FYI: MACRO1 is an auto-open macro

On a "Y" or "y" answer to "Do you wish to enter another tally? (Y/N)
question, I would like clear entered counts (data field) in th
worksheet, then continue macro execution at MACRO1. If the answer i
"N", macro execution ends.

Thanks for your interest!

Attachment filename: !!mldgfintly custom.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=63128
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top