Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
userform variables
Hi there hope some one can point me in the right direction. i dont seem to
be able to see the wood for the trees. I have a userform that I use to collect input from users, i also populate it from a data source. i use a list of field names that relate to both the range names on a worksheet and with a prefix of "UF" to the userform both in terms of controls and variables. I loop through the list and with the controls i use Range(field) = .Controls(form).Value. how do i deal with the variables "AdmissionDate", "DateTimeStamp" which in the code for the userform are prefixed by "UF" ie how do i pass the values to the relevant range please see following code 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", "DateTimeStamp" 'What do i use here? Case Else Range(field) = .Controls(form).Value End Select Next End With End With End With End Sub many thanks in anticipation -- Message posted via http://www.officekb.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform and variables | Excel Discussion (Misc queries) | |||
How to get get variables to move from userform to main sub? | Excel Programming | |||
Userform.Lable Variables | Excel Programming | |||
Passing variables between Sub and Userform | Excel Programming | |||
Passing variables from module to userform | Excel Programming |