incrementing field number

mona4

Board Regular
Joined
Sep 15, 2004
Messages
191
Hi,

Is there a way that every time you open a spreadsheet the field number on the sheet increments a bit like a counter?

Thanks
Mona
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi Mona

You could use a bit of code to increment a value in a cell - is this what you meant?

Code would look something like this (needs to go into ThisWorkbook module):

Code:
Private Sub Workbook_Open()
Sheets("YourSheetName").Range("A1").Value = Sheets("YourSheetName").Range("A1").Value + 1
End Sub

Best regards

Richard
 
Upvote 0
Yes i think so but would this be able to increment each time the spreadsheet form opens.

I have a purchase order form in excel. This is what the customer uses. Each order is a row on the form. Once they confirm the order by pressing a command button i want all the rows to display on another spreadsheet form which i use.

Is this possible?
 
Upvote 0
I am really confused....

I used the above code to increment the sheet. It wont give me the option to assign the code to the text box. I am also confused that i cannot even see the number on the sheet where it increments.
 
Upvote 0
Ok i can see the number displayed when i run the code. I wouldl like this displayed in a text box?
 
Upvote 0
Ok i can see the number displayed when i run the code. I wouldl like this displayed in a text box?
 
Upvote 0
This is the code in ThisWorkbook:

Private Sub Workbook_Open()
Sheet1.Range("J4") = Sheet1.Range("J4") + 1
End Sub

I am trying to display it in cell J4 in a TextBox. When i run it, it displays the create a macro dialog box. Dont know why.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top