View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Userforms and editing current records

Post your code for suggested modifications. To do what you want would
required knowing the row where you wrote the data. In advance, assume that
was indicated by the variable rw

msgbox cells(rw,"A").Value

assuming the concatentation is performed by a pre entered formula.

to edit data, assume a variable rw stores the "current" row

Textbox1.Text = cells(rw,2)
Textbox2.Text = Cells(rw,3)
Textbox3.Text = cells(rw,4)

populates the cells. Use a button or spinbutton to increment/decrement rw
and execute code like the above. Writing back is the same as you are doing
now, only you want to work on the "rw" you were editing.

--
Regards,
Tom Ogilvy



"Tom" wrote:

I've designed a simple userform in Excel VBA to insert new records into a
worksheet. It works fine, however there are a couple of things I would like
to do with it:


1) I would like it to report back in a message box the value of another
cell, say the A2, where the userform inserts data into B2 thro' to D2, with
A2 made up of a concatenation of B2 and C2 (to make up a ref Nos).

2) I would like the userform to be able to edit previous entries by clicking
on the previous or next button, or searching on one of the data entry fields,
say A2 - the ref Nos.

Can you help.

Tom