VBA Excel – 文本框中显示错误的值

我有一个列出客户的combobox,用户select一个客户,然后单击一个CommandButton来显示有关客户的相应信息。 有关客户的数据来自两张单独的工作表,ComboBox从工作表中的一个获取其清单。

虽然两张纸都有相同的客户,但有些客户在两张纸上都没有logging。 我遇到的问题是,当从ComboBox中select一个客户时,如果在另一个表中有一个客户,那么错误的数据行将显示在TextBox中。

Private Sub GoButton_Click() 'Finds ComboBox Value in RunDB, returns column 1 value NILWANo.Text = Range("RunDB!A2:U690").Cells(CustProfileCombo.ListIndex + 1, 1) RRank.Text = Range("RunDB!A2:U690").Cells(CustProfileCombo.ListIndex + 1, 2) CustClass.Text = Range("RunDB!A2:U690").Cells(CustProfileCombo.ListIndex + 1, 3) CalledDate.Text = Range("RunDB!A2:U690").Cells(CustProfileCombo.ListIndex + 1, 15) CustType.Text = Range("CustDB!A2:AA350").Cells(CustProfileCombo.ListIndex + 1, 3) 'Grabs Revenue data and formats in currency RevLast3.Text = Range("CustDB!A2:AA350").Cells(CustProfileCombo.ListIndex + 1, 11) Me.RevLast3.Value = Format(Me.RevLast3.Value, "$#,##0.00") RevLast12.Text = Range("CustDB!A2:AA350").Cells(CustProfileCombo.ListIndex + 1, 12) Me.RevLast12.Value = Format(Me.RevLast12.Value, "$#,##0.00") End Sub 

我试图改变Cells(CustProfileCombo.ListIndex + 1, 12)+2 ,并为0 ,但我仍然得到同样的问题。 我不擅长与VBA,不知道如何纠正我的代码。 任何帮助,将不胜感激。