I've got a workbook with two worksheets titled "Input" and "Data," and a for titled frmFeeWaiver. When the form is opened, I'd like to populate the text boxes within that form using data from the current row on the the two worksheets.
I tried the following code, but nothing happens when the form is opened. Would somebody mind taking a look and telling me what I've done wrong?
(FYI, the two worksheets have corresponding data, but the row number on the "Data" sheet is different than the row number on "Input," hence the separate row number variables.)
Any help that you can provide would be greatly appreciated!!!
I tried the following code, but nothing happens when the form is opened. Would somebody mind taking a look and telling me what I've done wrong?
(FYI, the two worksheets have corresponding data, but the row number on the "Data" sheet is different than the row number on "Input," hence the separate row number variables.)
Code:
Private Sub frmFeeWaiver_Activate()
Dim inputRow As Integer
Dim dataRow As Integer
inputRow = ActiveCell.Row
dataRow = inputRow - 5
txtReconPaid.Value = Sheets("Input").Range("L" & inputRow).Value
txtReconWaived.Value = Sheets("Data").Range("AB" & dataRow).Value
txtReconIn.Value = Sheets("Data").Range("AC" & dataRow).Value
txtStmtPaid.Value = Sheets("Input").Range("M" & inputRow).Value
txtStmtWaived.Value = Sheets("Data").Range("AE" & dataRow).Value
txtStmtIn.Value = Sheets("Data").Range("AF" & dataRow).Value
txtFaxPaid.Value = Sheets("Input").Range("N" & inputRow).Value
txtFaxWaived.Value = Sheets("Data").Range("AH" & dataRow).Value
txtFaxIn.Value = Sheets("Data").Range("AI" & dataRow).Value
txtUpdatePaid.Value = Sheets("Input").Range("O" & inputRow).Value
txtUpdateWaived.Value = Sheets("Data").Range("AK" & dataRow).Value
txtUpdateIn.Value = Sheets("Data").Range("AL" & dataRow).Value
txtAssnPaid.Value = Sheets("Input").Range("P" & inputRow).Value
txtAssnWaived.Value = Sheets("Data").Range("AN" & dataRow).Value
txtAssnIn.Value = Sheets("Data").Range("AO" & dataRow).Value
End Sub
Any help that you can provide would be greatly appreciated!!!