LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 115
Default Creating a Macro? V2

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a New Macro SharonJo Excel Discussion (Misc queries) 1 April 4th 08 01:27 AM
Creating Macro Chey Excel Discussion (Misc queries) 1 January 18th 07 06:21 PM
Macro Creating Duster142 New Users to Excel 2 October 7th 05 01:50 AM
Creating a macro Gene Goldenfeld New Users to Excel 10 May 5th 05 04:28 PM
Need Help Creating A Macro LJ Owen Excel Worksheet Functions 1 March 2nd 05 01:52 PM


All times are GMT +1. The time now is 04:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"