P
pjbur2005 via OfficeKB.com
Not sure if i am getting this over very well but here goes
I have a list called "Datalables"
in this list i have a value ""AdmissionDate"
I have a range called "AdmissionDate"
I have a userform With all controls prefixed with "UF"
in the userform i use a variable called "UFAdmissionDate"
i loop through the "Datalabels" list if = "AdmissionDate" i want the range
"AdmissionDate" to be given the Value Of "UFAdmissionDate"
if value is not "AdmissionDate" then i get the value of the control called
"UF" & the list value.
M when i run this i get 424 error object required can someone see what i am
doing wrong
Public Sub datatransfer()
With Workbooks("Cram")
..Activate
With Worksheets("info")
'cram is userform
With Cram
For Each field In Range("datalabels")
form = "uf" & field
Select Case field
Case "AdmissionDate"
' following line produces object required error 424
Worksheets("info").Range(field) = form.
Value
Case Else
Range(field) = .Controls(form).Value
End Select
Next
End With
End With
End With
End Sub
I have a list called "Datalables"
in this list i have a value ""AdmissionDate"
I have a range called "AdmissionDate"
I have a userform With all controls prefixed with "UF"
in the userform i use a variable called "UFAdmissionDate"
i loop through the "Datalabels" list if = "AdmissionDate" i want the range
"AdmissionDate" to be given the Value Of "UFAdmissionDate"
if value is not "AdmissionDate" then i get the value of the control called
"UF" & the list value.
M when i run this i get 424 error object required can someone see what i am
doing wrong
Public Sub datatransfer()
With Workbooks("Cram")
..Activate
With Worksheets("info")
'cram is userform
With Cram
For Each field In Range("datalabels")
form = "uf" & field
Select Case field
Case "AdmissionDate"
' following line produces object required error 424
Worksheets("info").Range(field) = form.
Value
Case Else
Range(field) = .Controls(form).Value
End Select
Next
End With
End With
End With
End Sub