Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can someone give me a formula so that I can have a number added automatically
to a cell each time I open a report. The number is 10-200-1 and each time I open the report I want it to automatically populate the fiield with the next number 10-200-2, 10-200-3 and so on. Thanks in advavnce for your help, Deborah |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When you say open a report I have assumed you mean open a workbook if so try
this Private Sub Workbook_Open() Sheets("Sheet1").Select 'Change to suit oldnum = Left(Range("A1").Value, 7) x = 1 + Val(Right(Range("A1").Value, Len(Range("A1").Value) - 7)) Range("A1").Value = oldnum & x End Sub Mike "Debbie" wrote: Can someone give me a formula so that I can have a number added automatically to a cell each time I open a report. The number is 10-200-1 and each time I open the report I want it to automatically populate the fiield with the next number 10-200-2, 10-200-3 and so on. Thanks in advavnce for your help, Deborah |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
By "open the report" , do you mean open the workbook? If so, and assuming
that the number is in Sheet1!A1 do the following. 1. Enter the initial number in the cell as a number value (no dashes) and give it a custom format of "00-000-00". 2. Then put this code in the ThisWorkbook code module: Private Sub Workbook_Open() With Sheet1.Range("A1") .Value = .Value + 1 End With End Sub -- Hope that helps. Vergel Adriano "Debbie" wrote: Can someone give me a formula so that I can have a number added automatically to a cell each time I open a report. The number is 10-200-1 and each time I open the report I want it to automatically populate the fiield with the next number 10-200-2, 10-200-3 and so on. Thanks in advavnce for your help, Deborah |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula to convert a number with spaces to just a number? | Excel Discussion (Misc queries) | |||
formula to throw out high number and low number | Excel Worksheet Functions | |||
Creating number formula to count number occurences in a data set | Excel Programming | |||
Formula to change scientific number to regular number or text | Excel Discussion (Misc queries) | |||
countif formula to find the occurances of a number that is greater than one number but less than another | Excel Discussion (Misc queries) |