Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I know how to create a form to add records in Excel. My need is to create a
form that allows a user to edit an existing record, without allowing the user to delete a record. Can someone point me in a helpful direction? -- Steve |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
in you code to load the record, you would just use code like
Textbox1.Text = Cells(i,1) TextBox2.Text = Cells(i,2) then to write it back, you similar code to that which you say you know. Cells(i,1) = Textbox1.Text Cells(i,2) = Textbox2.Text -- Regards, Tom Ogilvy "Steve" <No Spam wrote in message ... I know how to create a form to add records in Excel. My need is to create a form that allows a user to edit an existing record, without allowing the user to delete a record. Can someone point me in a helpful direction? -- Steve |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom
I get the general idea but, there may be a thousand or so records. Would there be a way to load the data and filter it down (example by date or user loginID)? -- Steve "Tom Ogilvy" wrote in message ... in you code to load the record, you would just use code like Textbox1.Text = Cells(i,1) TextBox2.Text = Cells(i,2) then to write it back, you similar code to that which you say you know. Cells(i,1) = Textbox1.Text Cells(i,2) = Textbox2.Text -- Regards, Tom Ogilvy "Steve" <No Spam wrote in message ... I know how to create a form to add records in Excel. My need is to create a form that allows a user to edit an existing record, without allowing the user to delete a record. Can someone point me in a helpful direction? -- Steve |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom
I think I have it. If userID = "whatever" Then TextboxLinenumber = i ... end if Correct? Steve "Steve" <No Spam wrote in message ... Tom I get the general idea but, there may be a thousand or so records. Would there be a way to load the data and filter it down (example by date or user loginID)? -- Steve "Tom Ogilvy" wrote in message ... in you code to load the record, you would just use code like Textbox1.Text = Cells(i,1) TextBox2.Text = Cells(i,2) then to write it back, you similar code to that which you say you know. Cells(i,1) = Textbox1.Text Cells(i,2) = Textbox2.Text -- Regards, Tom Ogilvy "Steve" <No Spam wrote in message ... I know how to create a form to add records in Excel. My need is to create a form that allows a user to edit an existing record, without allowing the user to delete a record. Can someone point me in a helpful direction? -- Steve |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
turn on the macro recorder, then do
Edit=Find and use Whatever as the search term then change the recorded code from Selection.Find(what:="Whatever", . . .).Activate to set rng = Columns(1).find(What:="Whatever", . . .) if not rng is nothing then ' cell was found with userform1 .textbox1.Text = rng .textbox2.Text = rng.offset(0,1) End With else ' not found End if or if you want to loop through your data, you can use your approach. -- Regards, Tom Ogilvy "Steve" <No Spam wrote in message ... Tom I think I have it. If userID = "whatever" Then TextboxLinenumber = i ... end if Correct? Steve "Steve" <No Spam wrote in message ... Tom I get the general idea but, there may be a thousand or so records. Would there be a way to load the data and filter it down (example by date or user loginID)? -- Steve "Tom Ogilvy" wrote in message ... in you code to load the record, you would just use code like Textbox1.Text = Cells(i,1) TextBox2.Text = Cells(i,2) then to write it back, you similar code to that which you say you know. Cells(i,1) = Textbox1.Text Cells(i,2) = Textbox2.Text -- Regards, Tom Ogilvy "Steve" <No Spam wrote in message ... I know how to create a form to add records in Excel. My need is to create a form that allows a user to edit an existing record, without allowing the user to delete a record. Can someone point me in a helpful direction? -- Steve |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom
Looping is slow. That's enough to work with. Thank you. -- Steve "Tom Ogilvy" wrote in message ... turn on the macro recorder, then do Edit=Find and use Whatever as the search term then change the recorded code from Selection.Find(what:="Whatever", . . .).Activate to set rng = Columns(1).find(What:="Whatever", . . .) if not rng is nothing then ' cell was found with userform1 .textbox1.Text = rng .textbox2.Text = rng.offset(0,1) End With else ' not found End if or if you want to loop through your data, you can use your approach. -- Regards, Tom Ogilvy "Steve" <No Spam wrote in message ... Tom I think I have it. If userID = "whatever" Then TextboxLinenumber = i ... end if Correct? Steve "Steve" <No Spam wrote in message ... Tom I get the general idea but, there may be a thousand or so records. Would there be a way to load the data and filter it down (example by date or user loginID)? -- Steve "Tom Ogilvy" wrote in message ... in you code to load the record, you would just use code like Textbox1.Text = Cells(i,1) TextBox2.Text = Cells(i,2) then to write it back, you similar code to that which you say you know. Cells(i,1) = Textbox1.Text Cells(i,2) = Textbox2.Text -- Regards, Tom Ogilvy "Steve" <No Spam wrote in message ... I know how to create a form to add records in Excel. My need is to create a form that allows a user to edit an existing record, without allowing the user to delete a record. Can someone point me in a helpful direction? -- Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel forms - authorise / deny forms | Excel Programming | |||
Why can't I edit my excel document? Edit buttons shaded. | New Users to Excel | |||
RefEdits and normal forms / forms in a DLL | Excel Programming | |||
Forms that open from forms | Excel Programming | |||
Calling Forms from Forms - Exit problems | Excel Programming |