Add these codes: [code] Private Sub UserForm_Activate() Dim AlphaInSlNo As String Dim NumInSlNo As String Dim LenSLNo As Integer Dim NewSlNo As String Sheets("VolunteerList").Select LastRecNum = Cells(Rows.Count, "a").End(xlUp).Row 'to go to last data cell inspite of blank cells Range("A" & Trim(Str(LastRecNum))).Select Debug.Print "Selection.Value=" & Selection.Value LenSLNo = Len(Selection.Value) AlphaInSlNo = Left(Selection.Value, 3) Debug.Print "AlphaInSlNo=Left(Selection.Value, 3)=" & Left(Selection.Value, 3) NumInSlNo = Int(Mid(Selection.Value, 4)) Debug.Print "NumInSlNo=" & NumInSlNo NewSlNo = Trim(Str(NumInSlNo + 1)) txtSlNo.Text = AlphaInSlNo & NewSlNo Do While Len(txtSlNo.Text) < LenSLNo AlphaInSlNo = AlphaInSlNo & Trim(Str(0)) txtSlNo.Text = AlphaInSlNo & NewSlNo Loop Debug.Print "txtSlNo.Text=" & txtSlNo.Text txtDtTIme.Text = Now End Sub [/code] [code] Private Sub cmdAdd_Click() Sheets("VolunteerList").Select LastRecNum = Cells(Rows.Count, "a").End(xlUp).Row 'to go to last data cell inspite of blank cells Range("A" & Trim(Str(LastRecNum + 1))).Select Selection.Value = txtSlNo.Text Selection.Offset(0, 2).Value = txtNam.Text 'Name entered in Name column Selection.Offset(0, 3).Value = txtCty.Text 'City entered in City column Selection.Offset(0, 4).Value = txtDtTIme.Text 'DtTIme entered in DtTIme column Call EmptyTextBoxes End Sub [/code] [code] Private Sub EmptyTextBoxes() txtSlNo.Text = "" txtNam.Text = "" txtCty.Text = "" txtDtTIme.Text = "" End Sub [/code] I have changed the names of Text Boxes and Command Button. Hope you can take care of ListBox.
On Sunday, December 1, 2013 4:48:27 PM UTC+5:30, renuka chari wrote: > > Dear group Please provide the userform code here serial no should be > capture on next record no on stored data sheet i.e volunteerlist if I > select the listbox items and enter the name city fields then click on add > button the data should be stored into volunteeerlist sheet date should > be disply the now date and time after click add data should be add to > data sheet as given and checkboxes and data would be clear and ready for > next entry Kindly provide this thanks > > > > > > > > > > *(¨`•.•´¨) Always `•.¸(¨`•.•´¨) Keep(¨`•.•´¨)¸.•´ Smiling!!`•.¸.•´Thanks & > Regards´¨) ¸ •´ ¸.•*´¨) ¸.•*¨) (¸.•´ (¸.•* > ♥♥♥...♪♪♪....RenukaChari. Kasee...♥♥♥...♪♪♪* > > *P Let us do our best to save nature, save water, plant trees, protect > greenery, keep our surroundings clean, reduce usage of plastics, and use > renewable energy sources.* > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/groups/opt_out.