Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 14th, 2005, 05:49 AM
Authorized User
 
Join Date: Sep 2003
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default moving around a page

hi again,

i am sort of getting the hang of this vba business now... thanks for all your help so far.

how do I go about changing the flow of how the code runs? for example, i would like to have an input box, where if the user clicks ok and the field is empty, it tells them that they must fill it in, and returns them to the input box so they can try again...

i thought it might be something like

Code:
'sender - name
    strSenderName = InputBox("Please Enter Your Name.", "Enter Name")
    'sender error handling
    If strSenderName = "" Then
        GoTo EmptySenderName:
    End If

EmptySenderName:
    MsgBox "You must enter a name to continue", vbCritical


which does work, but i don't know how to take it back to the input box...

thanks

patrick

Visit my site: http://www.drybonesuk.com
__________________
Visit my site: http://www.drybonesuk.com
 
Old October 17th, 2005, 02:42 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Patric,

Here's one example how to keep asking SenderName

strSenderName = InputBox("Please Enter Your Name.", "Enter Name")
If strSenderName = "" Then
    MsgBox "You must enter a name to continue", vbCritical
    ' Loop here until user enters sendername
    Do Until strSenderName <> ""
        strSenderName = InputBox("Please Enter Your Name.", "Enter Name")
    Loop

End If

-vemaju






Similar Threads
Thread Thread Starter Forum Replies Last Post
$_SESSION value gets cleared moving page to page crmpicco PHP How-To 1 November 3rd, 2007 10:04 AM
Moving Forms Apocolypse2005 Beginning VB 6 1 May 7th, 2007 11:40 AM
Moving viewport schoolBoy Javascript How-To 7 March 7th, 2007 05:03 PM
moving variable from one page to other Asteroid ASP.NET 1.0 and 1.1 Basics 1 November 30th, 2004 12:16 AM
Moving around a recordset Blaise Classic ASP Databases 6 June 25th, 2003 06:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.