View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Steen Steen is offline
external usenet poster
 
Posts: 104
Default Write data back from a form to sheet

Hi again (have been posted in Excel Programming also - sorry)

I would like to know how to write back the data from a form upon accept. The
form is activatied from a dubble_click on sheet2 (Tasklist), but I can't
figure out how to write the data back the the same row .

I would also appriciate some help on how to make a "next/previus" button work.

I have simplified the code below to be more illustrative:

Sheet2(Tasklist):

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Row 4 Then
Select Case Target.Column
Case 1
'initialize Tasklist form
frmTaskList.cboPriority.Value = Target.Offset(0, 7)
frmTaskList.txtHeadLine.Value = Target.Offset(0, 8)

'Call Tasklist form
frmTaskList.Show
End Select
End If
End Sub

Forms: frmTasklist:

Private Sub cmdAccept_Click()
If Me.cboPriority.Value = "" Then
MsgBox "Please enter Priority 1, 2 or 3 with 1 critical priority.",
vbExclamation, "Task Values"
Me.cboPriority.SetFocus
Exit Sub
End If

'write data back to sheet tasklist in the correct row?
???

End Sub

Hope fore some help again :-)

/Steen