+ Reply to Thread
Results 1 to 2 of 2

Finding proper row

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Finding proper row

    Private Sub CmdQASubmit_Click()
    
    If ComboBox19.Text = "" Then
        MsgBox ("You must select an Operator's Name")
    
    End If
    
    If ComboBox20.Text = "" Then
        MsgBox ("You must select a Reviewer's Name")
        
        Exit Sub
    End If
    
    
    row_number = 0
    
    'added in
    column_number = 0
    
    Do
    DoEvents
    row_number = row_number + 1
    
    'added in
    
    column_number = Sheets("QA").Range("A1").End(xlToRight).Column + 1
    
    
    item_in_review = Sheets("DATABASE").Range("A" & row_number)
    scores = Sheets("QA").Range("A" & column_number)
    
        If item_in_review = ComboBox19.Text Then
            Sheets("DATABASE").Range("AG" & row_number) = ComboBox1.Text
           
           'added in
        If ComboBox1.Text = "Non-Satisfactory" Then
            Worksheets("QA").Range("D" & column_number) = "1"
        End If
        
        End If
        If item_in_review = ComboBox19.Text Then
            Sheets("DATABASE").Range("AH" & row_number) = ComboBox2.Text
            Sheets("DATABASE").Range("AI" & row_number) = ComboBox3.Text
            Sheets("DATABASE").Range("AJ" & row_number) = ComboBox4.Text
            Sheets("DATABASE").Range("AK" & row_number) = ComboBox5.Text
            Sheets("DATABASE").Range("AL" & row_number) = ComboBox6.Text
            Sheets("DATABASE").Range("AM" & row_number) = ComboBox7.Text
            Sheets("DATABASE").Range("AN" & row_number) = ComboBox8.Text
            Sheets("DATABASE").Range("AO" & row_number) = ComboBox9.Text
            Sheets("DATABASE").Range("AP" & row_number) = ComboBox10.Text
            Sheets("DATABASE").Range("AQ" & row_number) = ComboBox11.Text
            Sheets("DATABASE").Range("AR" & row_number) = ComboBox12.Text
            Sheets("DATABASE").Range("AS" & row_number) = ComboBox13.Text
            Sheets("DATABASE").Range("AT" & row_number) = ComboBox14.Text
            Sheets("DATABASE").Range("AU" & row_number) = ComboBox15.Text
            Sheets("DATABASE").Range("AV" & row_number) = ComboBox16.Text
            Sheets("DATABASE").Range("AW" & row_number) = ComboBox17.Text
            Sheets("DATABASE").Range("AZ" & row_number) = ComboBox20.Text
            Sheets("DATABASE").Range("BA" & row_number) = TextBox10.Text
            
        
      
    
      
      End If
      
    
        
        
    
        
    Loop Until item_in_review = ""
    
    ComboBox1 = ""
    ComboBox2 = ""
    ComboBox3 = ""
    ComboBox4 = ""
    ComboBox5 = ""
    ComboBox6 = ""
    ComboBox7 = ""
    ComboBox8 = ""
    ComboBox9 = ""
    ComboBox10 = ""
    ComboBox11 = ""
    ComboBox12 = ""
    ComboBox13 = ""
    ComboBox14 = ""
    ComboBox15 = ""
    ComboBox16 = ""
    ComboBox17 = ""
    ComboBox18 = ""
    ComboBox19 = ""
    
    
    
    Dim resp
    
    resp = MsgBox("Do you have any others to complete?", vbYesNo)
    If resp = vbNo Then
        Unload Me
        
    End If
    
    End Sub
    Hello all,
    In the above-listed code, I am trying to account for scores of Non-Satisfactory. Column A on the QA sheet is exactly the same as column A on the DATABASE sheet. You will see where I put
         'added in
        If ComboBox1.Text = "Non-Satisfactory" Then
            Worksheets("QA").Range("D" & column_number) = "1"
        End If
    which is sending all of the information to the D column but not the correct row that is associated with the person's name.

    Can anyone help me modify this? Thanks

  2. #2
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: Finding proper row

        Dim LastRow As Object
              Set LastRow = Sheets("Sheet2").Range("A65536").End(xlUp)
              
          With LastRow
              .Offset(1, 0) = ComboBox2.Text
              .Offset(1, 1) = ComboBo3.Text
              .Offset(1, 2) = ComboBox4.Text
              .Offset(1, 3) = ComboBox5.Text
              .Offset(1, 4) = ComboBox6.Text
              .Offset(1, 5) = ComboBox7.Text
              .Offset(1, 6) = ComboBox8.Text
              .Offset(1, 7) = ComboBox9.Text
              .Offset(1, 8) = ComboBox10.Text
              .Offset(1, 9) = ComboBox11.Text
              .Offset(1, 10) = ComboBox12.Text
              .Offset(1, 11) = ComboBox13.Text
              .Offset(1, 12) = ComboBox14.Text
              .Offset(1, 13) = ComboBox15.Text
              .Offset(1, 14) = ComboBox15.Text
              .Offset(1, 15) = ComboBox16.Text
              .Offset(1, 16) = ComboBox17.Text
    I found this online. If I wanted the text of each combobox to go to the next available cell on Sheet2, would this work, and where would I need to put it? I've tried it in a few places, and I'm getting errors.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Finding Proper Names in a Cell of Text
    By hiimdoug in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-05-2013, 04:53 PM
  2. Replies: 2
    Last Post: 12-20-2010, 07:27 PM
  3. Replies: 10
    Last Post: 12-17-2009, 02:00 AM
  4. Replies: 3
    Last Post: 03-02-2007, 07:13 AM
  5. Finding a proper number.
    By A-Design in forum Excel General
    Replies: 2
    Last Post: 12-04-2005, 12:55 AM

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