I would like to create an udf with the text function. For example: wojob=text(wo,"ooooo") & text(job, "ooo") with wo being the value in one cell and job is a other. Thanks.
I would like to create an udf with the text function. For example: wojob=text(wo,"ooooo") & text(job, "ooo") with wo being the value in one cell and job is a other. Thanks.
Last edited by jollycub; 05-21-2013 at 11:19 AM. Reason: Change heading to solved
VBA has a Format function that is almost the same as the worksheet TEXT function.
wojob = Format(wo, "00000") & Format(job, "000")
Or you can use the TEXT function like this...
With Application.WorksheetFunction
wojob = .Text(wo, "00000") & .Text(job, "000")
End With
<Frog wins> <sigh>
Perhaps it was the Noid who should have avoided me...
If you are satisfied with my solution click the small star icon on the left. Thanks
1. Make a copy of your workbook and run the following code on your copy (just in case)
2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
3. Paste the code from above into the empty white space. Close the VBE.
4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".
You're still more interesting than me Al.
Thanks, here is my function:
Please Login or Register to view this content.
Last edited by arlu1201; 05-21-2013 at 11:45 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks