Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Peter,
I can't remeber who developed this originally but it was an update function that saved me. I have mucked around with the original code. All that happens in this is once you load in the data record you want, then add the new data (or change existing data) and then when activated the code determines if the staff names exists and then adds or replaces the data. Sub StaffDetialsUpdate() Dim rng As Range Dim idex As Long 'determines if the staffname alread exists in the list If Staff.StaffNames.ListIndex = -1 Then 'if the staff name doesn't exist in the list then tell them to use the add fucntion MsgBox "This is a new entry - try ADD" Else 'get the staff name idex = Staff.StaffNames.ListIndex 'find range for staff names in database Set rng = Worksheets("staff database").Range("A1") Set rng = rng(Staff.StaffNames.List(idex, 1)) 'rng for data to be posted from which enterypoints in the Staff form rng(1, 2).Value = Staff.Proposed.Value rng(1, 3).Value = Staff.Title.Text 'could use a loop depending on names End if End Sub "Peter" wrote in message ... On Wed, 6 Oct 2004 23:41:13 +0100, "Bob Phillips" wrote: Peter, Not the answer to your question, but have you looked at DataForm, it allows managing a dataset very easily. Hi Bob, Yes, I've used Data|Form previously, but in this instance I need to enter some data in a form and have that data entered into an existing row in a spreadsheet i.e. Cells S1:S7 already have data in them. My form would select row 7 by virtue of the unique reference in cell S1 and the data in my form would then be added to cells S8:S15. -- Cheers Peter Remove the INVALID to reply |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
combo box - VBA form | Excel Discussion (Misc queries) | |||
linking a form combo box... results from the combo box to another | Excel Discussion (Misc queries) | |||
combo boxes on a form | Excel Discussion (Misc queries) | |||
VBA Form Combo Box question. | Excel Discussion (Misc queries) | |||
Form Combo Box | Excel Discussion (Misc queries) |