View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Populate a Userform from an existing Record.

Dim rng as Range, res as Variant
Dim rng1 as Range
With worksheets("Sheet1")
set rng = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
End with
res = Application.Match(me.Textbox1.Text,rng,0)
if not iserror(res) then
set rng1 = rng(res)
me.Textbox2 = rng1.offset(0,1)
me.Textbox3 = rng1.offset(0,2)
Else
msgbox me.Textbox1.Text & " was not found"
End if

if you have your "index" values loaded into a combobox, then use the
combobox1.ListIndex property to find the row.

--
regards,
Tom Ogilvy

"Dooley007" wrote in message
ups.com...
I am making a database that will contain about 1500 records when it is
completed. I have need to go back into certain Records and make
corrections to the data. I have been able to select the record (by
searching for the Last Name) I want to change but I would like to
re-populate a userform with the existing data and then make any
necessary revisions. Then I will add the revised record back into its
original place.

I can't seem to get the info back into a userform so that my program
will run and make the changes to approprate cells. Any help would be
greatley appreciated.

I hope this is clear enough and someone with more programming knowledge
will be able to help.