Results 1 to 3 of 3

Do while loop not working

Threaded View

rikkyshh Do while loop not working 10-09-2013, 12:23 PM
xladept Re: Do while loop not working 10-09-2013, 01:32 PM
GC Excel Re: Do while loop not working 10-09-2013, 01:47 PM
  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    65

    Do while loop not working

    Macro below

    It should just ask the user if they want to enter another set of data and skip down to the next row and then ask them again
    Sub TestMacro()
    Dim question As String
    
    question = InputBox("Add another?")
    
    If question = "N" Or question = "Y" Then
        Do While question = "Y"
    
        ActiveCell.Offset(0, 0).Select
        ActiveCell.FormulaR1C1 = InputBox("Date")
        ActiveCell.Offset(0, 1).Select
        ActiveCell.FormulaR1C1 = InputBox("Project #")
        ActiveCell.Offset(0, 1).Select
        ActiveCell.FormulaR1C1 = InputBox("Fault")
        ActiveCell.Offset(0, 1).Select
        ActiveCell.FormulaR1C1 = InputBox("Problem")
        ActiveCell.Offset(0, 1).Select
        ActiveCell.FormulaR1C1 = InputBox("Solution")
        ActiveCell.Offset(1, -4).Select
        
        question = InputBox("Add another?")
        
        Loop
        
        MsgBox "OK"
        
    End If
    
    End Sub
    Last edited by Leith Ross; 10-09-2013 at 12:40 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Loop not working...
    By yunesm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2011, 08:12 AM
  2. Loop not working
    By blankus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2009, 04:16 AM
  3. Why is this Do Loop not working right?
    By evilrtc in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-21-2007, 01:52 AM
  4. Loop not working!!
    By Simon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2005, 12:05 PM
  5. Do...Loop not working
    By Sunny Lin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-13-2005, 09:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1