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

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
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,873
Messages
6,122,029
Members
449,061
Latest member
TheRealJoaquin

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