I am trying to set up a form to display data from various worksheets and to allow data entry to update across worksheets.
The following code resides under module1 but it fails to populate data into the listbox when I run it. I am new to the activeworkbook.names.add function, I am probably not using correctly, can some one help.
Sub present_form()
MsgBox " Hi form process "
Sheet6.Activate
lastrow = Range("A600").End(xlUp).Row
ActiveWorkbook.Names.Add Name:="listCourses", RefersTo:="=Sheet6!$A$2:$A$" & lastrow
MsgBox "lastrow " & lastrow
frmRound.lstCourses.Value = listCourses
frmRound.lblCourse.Caption = "Courses Listed in " & Sheet6.Name
frmRound.Show
End Sub
The following code resides under module1 but it fails to populate data into the listbox when I run it. I am new to the activeworkbook.names.add function, I am probably not using correctly, can some one help.
Sub present_form()
MsgBox " Hi form process "
Sheet6.Activate
lastrow = Range("A600").End(xlUp).Row
ActiveWorkbook.Names.Add Name:="listCourses", RefersTo:="=Sheet6!$A$2:$A$" & lastrow
MsgBox "lastrow " & lastrow
frmRound.lstCourses.Value = listCourses
frmRound.lblCourse.Caption = "Courses Listed in " & Sheet6.Name
frmRound.Show
End Sub