Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Numbering

Status
Not open for further replies.

max1565

Technical User
Dec 16, 2002
57
US
I have an application that gathers information from the user via userforms, the information goes into excel database. When the user completes the last userform, they want to save the form. If the user selects yes, then the info is transferred from the database to a form I have set up on sheets("form").

What i would like to have happen is for code to number the form with the next number, and place that number in Sheets("form").Range("e1")

Appreciate any help you can provide. Using excel 2000, win 2000.

Thanks
 
Hi Max1565,
Huh, Excel is not a database, information can't be saved onto a form, I'm not sure what you want it to do, but maybe this will get you going in the right direction?


Sub doThis()
Dim variable1

variable1 = ActiveWorkbook.Worksheets("sheet1").Range("e1").Value
variable1 = variable1 + 1
ActiveWorkbook.Worksheets("sheet1").Range("e1").Value = variable1
ActiveWorkbook.Worksheets.Add.Move after:=Worksheets(Worksheets.Count)
ActiveWorkbook.Worksheets(ActiveWorkbook.Worksheets.Count).Name = "Form" & variable1
End Sub

[pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top