Add text to formula result

Mr_Adams

Active Member
Joined
Oct 7, 2002
Messages
475
I use this formula to give me new invoices numbers each time the worksheet is opened.
=MAX('\\Ice\Fin_Data\Invoices\2003\[Finance Invoice Ledger 2003.xls]Finance Invoice Ledger 2003'!$A:$A)+1
How can I put text in front of the result and insure the numeric value is 5 didgits.

Example:
The formula result is 560.
But I want the result to be FIN-00560.

Thank you for any help.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
If it's only for display purposes, then you could use this custom number format with your formula..."FIN-"00000
 
Upvote 0
That worked perfect, Juan. However there is another problem that I didn't anticipate. I use the template wizard to save records. The invoice number that it stores for the above example is FIN-00560. But when the worksheet is opened next time the result is FIN-00001 becuase FIN-00560 is entry the formula is trying to add 1 to. any ideas on how to correct this.
 
Upvote 0
Thanks tommy that was a good solution.
But when the worksheet is saved it is saved as 560 instead of FIN-00560.
Any Ideas on how to change the following code to save as the complete invoice number
Private Sub Workbook_BeforeClose(Cancel As Boolean)
' *******************************************************************
' * Forces Database update and saves new file as the Invoice Number *
' *******************************************************************
Application.Run "commit"
ActiveWorkbook.SaveAs FileName:="\\Ice\Fin_Data\Invoices\2004\Invoices\" & Range("L13")
End Sub
 
Upvote 0
Thank You

I see that it works, but I'm not sure I inderstand. does the .Text mean what is displayed in the cell instead of the the formula result is, since what is displayed is different?
 
Upvote 0

Forum statistics

Threads
1,222,095
Messages
6,163,891
Members
451,864
Latest member
Pandorom

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