ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using Char() in Macro (https://www.excelbanter.com/excel-programming/288323-using-char-macro.html)

slideman[_3_]

Using Char() in Macro
 
Hello,
I built a system that generate invoice number.
Now it work on excel , and i want to convert it to macro in vba.
My problem is that you can't use char() in vba.
I need the generator to generate number of invoice with the date the
day and A,B,C............ I give an exmpale:
Lets say I did three invoices on the date 11/8/04, the invoice genrate
will give me :
1) 040811
2) 040811A
3) 040811B

For now i use in excel : =TEXT(TODAY(),"yymmdd") & Char(65)

Thanks for your help..........:confused:


---
Message posted from http://www.ExcelForum.com/


Chip Pearson

Using Char() in Macro
 
Use the Chr() function. E.g.,

Dim S As String
S = Format(Now,"yymmdd") & Chr(65)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"slideman " wrote in
message ...
Hello,
I built a system that generate invoice number.
Now it work on excel , and i want to convert it to macro in

vba.
My problem is that you can't use char() in vba.
I need the generator to generate number of invoice with the

date the
day and A,B,C............ I give an exmpale:
Lets say I did three invoices on the date 11/8/04, the invoice

genrate
will give me :
1) 040811
2) 040811A
3) 040811B

For now i use in excel : =TEXT(TODAY(),"yymmdd") & Char(65)

Thanks for your help..........:confused:


---
Message posted from http://www.ExcelForum.com/




slideman[_4_]

Using Char() in Macro
 
Thanks Alot, it help me very muc

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 01:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com