Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I don't know how to reply to a post and get it to come back to the top of the
list so I am starting a new thread under the same heading. Sorry everyone. Pete and Gord responded to my original thread but unfortunately I was not able to get their advice to work. My original question related to a four page survey. The survey is posted on our intranet at work for people exiting our employment. Once they have completed the survey they activate the submit button returning the survey to our HR people. The survey contains four pages (worksheets) with the submit button on the last page (page four). When the submit button is activated it emails the workbook. When the recipients opens the workbook it opens at page four because that was the last page open and the one with the submit button on it. I want the macro to basically return the workbook to page one when the submit button is activated so that when the recipients open the workbook they see page one first and not page four. The VBE I am using is below and is one of Debras (I just wish I knew how to write this stuff, but I am learning a little bit, obviously not enough though) Sub Mail_workbook_1() Dim wb As Workbook Set wb = ActiveWorkbook If Val(Application.Version) = 12 Then If wb.FileFormat = 51 And wb.HasVBProject = True Then MsgBox "There is VBA code in this xlsx file, there will be no VBA code in the file you send." & vbNewLine & _ "Save the file first as xlsm and then try the macro again.", vbInformation Exit Sub End If End If On Error Resume Next wb.SendMail Array("email.address"), _ "Exit Survey" On Error GoTo 0 End Sub Sorry this is so long. Cheers |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating a New Macro | Excel Discussion (Misc queries) | |||
Creating Macro | Excel Discussion (Misc queries) | |||
Macro Creating | New Users to Excel | |||
Creating a macro | New Users to Excel | |||
Need Help Creating A Macro | Excel Worksheet Functions |