LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default variable problem error 424

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime Error '91' Object variable or With block variable not set Alec Coliver Excel Discussion (Misc queries) 2 October 24th 09 02:29 PM
Runtime Error 91 Object variable or With block variable not set. Tim Excel Programming 9 June 5th 08 10:03 PM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM
Error trap with object variable problem Mike H[_7_] Excel Programming 1 February 6th 04 09:09 AM


All times are GMT +1. The time now is 12:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"