+ Reply to Thread
Results 1 to 13 of 13

Update Missing Info Before Capture - Excel VBA

  1. #1
    Registered User
    Join Date
    10-06-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Unhappy Update Missing Info Before Capture - Excel VBA

    I am trying to make data capture sheet in excel and added capture button. I want
    the users to complete the excel form and then hit Capture, which then captures the data in a .txt file. I have put together below VBA code with some help. The real issue is,if any field is missing it pops up the msg but as soon as I click Ok (on the msg), it captures data instead of going back to incomplete form for the user to update missing field. I am new to this stuff and need help........

    Please Login or Register  to view this content.
    Last edited by Ayaz Shaikh; 10-06-2011 at 05:19 AM. Reason: Comply with forum rules

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Excel VBA Help

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Excel VBA Help

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    I will add them for you this time

  4. #4
    Registered User
    Join Date
    10-06-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Excel VBA Help

    Bob,

    I filled the sheet completely but still it gives me the msg and doesn't print.

    Help...

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Excel VBA Help

    Your post does not comply with Rule 7 of our Forum RULES. Please do not ignore Moderators' or Administrators' requests - note that this includes requests by senior members as well, if you are unclear about their request or instruction then send a private message to them asking for help. Do not post a reply to a thread where a moderator has requested an action that has not been complied with e.g Title change or Code tags...etc

  6. #6
    Registered User
    Join Date
    10-06-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Update Missing Info Before Capture - Excel VBA

    This doesn't print and still gives msg even when all fields are complete.

  7. #7
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Excel VBA Help

    Quote Originally Posted by arthurbr View Post
    Your post does not comply with Rule 7 of our Forum RULES. Please do not ignore Moderators' or Administrators' requests - note that this includes requests by senior members as well, if you are unclear about their request or instruction then send a private message to them asking for help. Do not post a reply to a thread where a moderator has requested an action that has not been complied with e.g Title change or Code tags...etc
    You said you would add them, and you did

  8. #8
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Update Missing Info Before Capture - Excel VBA

    That was about the thread title not being changed. I didn't know you cared about that Bob?

  9. #9
    Registered User
    Join Date
    10-06-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Update Missing Info Before Capture - Excel VBA

    Bob,

    Please help me fix the excel issue.

    Even after completing the form it still gives me msg 'Please update missing information' when I click on Capture Score button, doesn't capture & reset the excel form.

    Rgds
    Ayaz Shaikh

  10. #10
    Registered User
    Join Date
    10-06-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Update Missing Info Before Capture - Excel VBA

    Somone please help

  11. #11
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Update Missing Info Before Capture - Excel VBA

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    10-06-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Update Missing Info Before Capture - Excel VBA

    This doesn't work.

    After completing all field it still gives msg.


    Code :
    Sub Capture_Score()
    '
    ' Capture_Score Macro
    '

    With Sheet1

    If .Cells(3, 2).Value = "" & .Cells(4, 2).Value = "" & .Cells(5, 2).Value = "" & _
    .Cells(6, 2).Value = "" & .Cells(9, 2).Value = "" & .Cells(10, 2).Value = "" & _
    .Cells(11, 2).Value = "" & .Cells(12, 2).Value = "" & .Cells(13, 2) & .Cells(14, 2).Value = "" Then

    Cancel = False

    Const myfile As String = "\\00172fpsjnb0007\p135668$\Centralised Lending\Application Assessment\" & _
    "Application Quality.txt"
    fnum = FreeFile()

    Open myfile For Append As fnum

    Print #fnum, .Cells(3, 2).Value & "|" & .Cells(4, 2).Value & "|" & _
    .Cells(5, 2).Value & "|" & .Cells(6, 2).Value & "|" & _
    .Cells(9, 2).Value & "|" & .Cells(10, 2).Value & "|" & _
    .Cells(11, 2).Value & "|" & .Cells(12, 2).Value & "|" & _
    .Cells(13, 2).Value & "|" & .Cells(14, 2).Value

    Close #fnum

    .Cells(4, 2).Value = ""
    .Cells(6, 2).Value = ""
    .Cells(9, 2).Value = ""
    .Cells(10, 2).Value = ""
    .Cells(11, 2).Value = ""
    .Cells(12, 2).Value = ""
    .Cells(13, 2).Value = ""
    .Cells(14, 2).Value = ""
    Else

    MsgBox "Please update missing information"
    End If
    End With
    End Sub

  13. #13
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Update Missing Info Before Capture - Excel VBA

    If you keep refusing to use code tags, you are likely to get banned

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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