R
RussellT
I have a form with 78 TextBoxes on it and a WorkSheet with 78 Columns. I want
to fill the form with the data on a specific row of the WorkSheet. I've
written the following code but can't figure out why it doesn't work.
Public Sub LoadLongInfo3(ByVal selectedProject As String)
Dim databaseRow As Long
Dim Boxes As Integer
Dim BoxName As String
Set devdataSheet = Sheets("DevData")
'Find DataRows To Be Loaded Into Form
devdataSheet.Activate
devdataSheet.Cells.Find(What:=selectedProject,
After:=devdataSheet.Cells(1,1), LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, MatchCase:=True).Activate
databaseRow = ActiveCell.Row
'Load Data Into Form
For Boxes = 1 To 78
BoxName = "TempBox" & Boxes
BoxName.Value = devdataSheet.Cells(databaseRow, Boxes)
Next
End Sub
When I run this code I get error message Object Required and the codes stops
at the line:
BoxName.Value = devdataSheet,Cells(databaseRow, Boxes)
Any help would be appreciated.
to fill the form with the data on a specific row of the WorkSheet. I've
written the following code but can't figure out why it doesn't work.
Public Sub LoadLongInfo3(ByVal selectedProject As String)
Dim databaseRow As Long
Dim Boxes As Integer
Dim BoxName As String
Set devdataSheet = Sheets("DevData")
'Find DataRows To Be Loaded Into Form
devdataSheet.Activate
devdataSheet.Cells.Find(What:=selectedProject,
After:=devdataSheet.Cells(1,1), LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, MatchCase:=True).Activate
databaseRow = ActiveCell.Row
'Load Data Into Form
For Boxes = 1 To 78
BoxName = "TempBox" & Boxes
BoxName.Value = devdataSheet.Cells(databaseRow, Boxes)
Next
End Sub
When I run this code I get error message Object Required and the codes stops
at the line:
BoxName.Value = devdataSheet,Cells(databaseRow, Boxes)
Any help would be appreciated.