I have a master file that will have a transaction number generated, data will be entered by the user and lookups will be performed on the data they enter. The file is then going to be saved in a named folder using the transaction number generated as the file name.xls.
The transaction number is simply taking a seed number and adding one to it. My problem comes in when I save the file as the new transaction number.xls the original transaction seed number in the master file doesn’t get saved, therefor I end up with all my transaction numbers being the same.
Here is the code snippet I am using to increment the transaction number:
Sub New_MTR_Number()
LastMTR = Worksheets("OldMTRNumber").Range("A1").Value
NextMTR = LastMTR + 1
Worksheets("MTR").Range("E6").Value = NextMTR
Worksheets("OldMTRNumber").Range("A1").Value = NextMTR
End Sub
After saving the newly named file to a transaction folder, this file would be closed, and the new transaction number lost. My thought is to save this master file when the transaction number is incremented, then when the other data has been entered for the lookup, it can be saved using save as to the new file name (transaction number.xls)
Somehow, I feel that I am making this harder than it should be, and I will appreciate any help I can get.
Thanks
The transaction number is simply taking a seed number and adding one to it. My problem comes in when I save the file as the new transaction number.xls the original transaction seed number in the master file doesn’t get saved, therefor I end up with all my transaction numbers being the same.
Here is the code snippet I am using to increment the transaction number:
Sub New_MTR_Number()
LastMTR = Worksheets("OldMTRNumber").Range("A1").Value
NextMTR = LastMTR + 1
Worksheets("MTR").Range("E6").Value = NextMTR
Worksheets("OldMTRNumber").Range("A1").Value = NextMTR
End Sub
After saving the newly named file to a transaction folder, this file would be closed, and the new transaction number lost. My thought is to save this master file when the transaction number is incremented, then when the other data has been entered for the lookup, it can be saved using save as to the new file name (transaction number.xls)
Somehow, I feel that I am making this harder than it should be, and I will appreciate any help I can get.
Thanks