Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200809/1 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You have
form.value but form is a variable and not an object so it does not have a value property... Try Worksheets("info").Range(field) = form -- HTH... Jim Thomlinson "pjbur2005 via OfficeKB.com" wrote: 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 -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200809/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
Runtime Error 91 Object variable or With block variable not set. | Excel Programming | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming | |||
Error trap with object variable problem | Excel Programming |