Hello,

I don't know if this is the appropriate area of the forum to post this. I know there is a VBA section for excel, but I didn't know if this would go there as it's a VBA Word question.

I have to print out a sequentially increasing number code on some labels at work. I currently have a form with the correct layout that is coded to prompt me for the starting number and the number of pages of labels I want. I've got all that working. If I tell it to start at 1, ten it will do 1 through 30 labels on that one sheet, print, and the do 31-60. It'll repeat till it hits the number of sheets I told it to print.

I have it set that if I don't enter a number of sheets to print, it defaults to 1 sheet. I'd like it to do the same thing if I don't input a starting number. I'd like it to default to the next number in the sequence and run the program to make the labels and print them out. The problem I have is that I don't know how to store that number after the program is shut down. The number is being pulled from a variable I have saved as a public variable called IntLastNum. I'd like to be able to have the program store the last number used in this variable, which it does, then save it and upon reopening the document, it should pull the last number and proceed from there.

So in the instance I mentioned above, where I printed out labels 1-30 on one sheet and then did 31-60. I should be able to shut the document down, come back in a couple of weeks, leave the starting number blank and have it print labels 61-90. I read that it should save it when the program is saved and I was previously just closing the program and telling it not to save, so that the cells would be empty when I opened it back up. Instead, I have a piece of code that when the document closes, it clears the cells, sets the cursor back to the first cell, and saves the document. Thanks for the help.