A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

changing calculations in a cell



 
 
Thread Tools Display Modes
  #1  
Old February 6th, 2004, 10:01 PM
Paula
external usenet poster
 
Posts: n/a
Default changing calculations in a cell

I want to add a function that will automatically add 1 number at a time in a cell by calculating only that cell. Reason-I want my invoice # to increase by 1 each time I use it.
  #2  
Old February 6th, 2004, 10:35 PM
Scott
external usenet poster
 
Posts: n/a
Default changing calculations in a cell

Do you have to input the invoice number each time? Or,
could you just prenumber them, and input the rest of your
data? If they are sequential, once you put in your first
two numbers, click and drag over the two cells, release,
then click and hold on the fill box (lower right corner of
the cell) and drag down the column.

Cheers!

-----Original Message-----
I want to add a function that will automatically add 1

number at a time in a cell by calculating only that cell.
Reason-I want my invoice # to increase by 1 each time I
use it.
.

  #3  
Old February 6th, 2004, 11:17 PM
Frank Kabel
external usenet poster
 
Posts: n/a
Default changing calculations in a cell

Paula wrote:
I want to add a function that will automatically add 1 number at a
time in a cell by calculating only that cell. Reason-I want my
invoice # to increase by 1 each time I use it.


Hi Paula
this can't be done with a formula. You'll need VBA for this. The
following code will increase the number in cell A1 on Sheet 1 each time
you open your workbook.
1. Create a new workbook or open an existing workbook. Design
everything as you like, etc. You will dedicate a single cell for your
invoice number. Lets say a an assumption it is cell A1 on the first
sheet (name 'sheet1').
2. Save this Excel sheet.
3. Right click on the Excel symbol left to your menu entry 'File'.
Choose 'Code' in the context menu. The VBA editor will open.
4. Paste the following code into the VBA editor:
Private Sub Workbook_Open()
Worksheets("Sheet1").Select
Range("A1").Value = Range("A1") + 1
End Sub
5. Close the VBA editor, save the Excel file and close it.

Now the number should increase everytime you open this file

Frank

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:46 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.