紧急!如何将10000转换为A000 [英] URGENT! How to convert 10000 to A000

查看:143
本文介绍了紧急!如何将10000转换为A000的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有一个从1到37000的整数。我想创建一个报告

excel

以4个字母数字长度显示。


示例:

我可以将cutomerID从1到9999写为:

1 ----> 0001

2 ----> 0002

.....

.....

9999 ----> 9999


我想写一下


10000 ----->作为A000

10001 ----->作为A001

.....

.....

.....

11000 ----->作为B000

11001 ----->作为B001


有谁知道简单的方法来实现这个目标?


Rgds,

Niyazi

我非常感谢你阅读我的帖子。

解决方案

你好,Niyazi,

可能有很多方法。一个是:


Dim chraPrefix As Char()=" 0123456789" &安培; _

" ABCDEFGHIJKLMNOPQRSTUVWXYZ"

Dim strID = chraPrefix(Int(intID / 1000))& _

(intID Mod 1000).ToString(" 000")

这是否是最简单的(或最好的)我不能说。


但是你想在cutomerID>时发生什么? 35999?


干杯,

兰迪

Niyazi写道:

大家好,

我有1到37000的整数。我想在
excel
中创建一个以4个字母数字长度显示的报告。
示例:
我可以将cutomerID从1到9999编写为:
1 ----> 0001
2 ----> 0002
....
.... 9999 ----> 9999

我想写一下这个万维网----->如A000
10001 ----->如A001
....
....
....
11000 ----->如B000
11001 ----->作为B001

有谁知道简单的方法来实现这个目标?

Rgds,
Niyazi
我非常感谢你阅读我的帖子。


嗨兰迪,


谢谢您的回复。你的解决方案适合我一段时间,但

你是对的。现在我也想知道ID号是否有6位数字说

112007.我必须转换为长度为4的字母数字。


我我猜我必须把10000分区和0000分开。但我真的不知道如何实现你以前的答案。


我真的很抱歉说可以重新安排你的代码

将长度为4的字母数字字符转换为最多6位数字。


我非常高兴您的回复非常快。


谢谢。


Rgds,

Niyazi


" R.麦克唐纳"写道:

你好,Niyazi,

可能有很多方法。一个是:

Dim chraPrefix As Char()=" 0123456789" &安培; _
" ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Dim strID = chraPrefix(Int(intID / 1000))& _
(intID Mod 1000).ToString(" 000")

这是否是最简单的(或最好的)我不能说。

但是当cutomerID>你想要发生什么? 35999?

干杯,
Randy

Niyazi写道:

大家好,
我有一个从1到37000的整数。我想在
excel
中创建一个以4个字母数字长度显示的报告。

示例:
我可以将cutomerID从1到9999写为:
1 ----> 0001
2 ----> 0002
....
.... 9999 ----> 9999

我想写一下这个万维网----->如A000
10001 ----->如A001
....
....
....
11000 ----->如B000
11001 ----->作为B001

有谁知道简单的方法来实现这个目标?

Rgds,
Niyazi
我非常感谢你阅读我的帖子。



嗨兰迪,


我相信身份证号码不会达到1,000,000点。但是如果我有一个介于1到999,999之间的

整数,那么可以从

0001(零,零,零)转换起始

一)达到zzzz。 ZZZZ之后的财富比起来还要像aaaa那样开始。或者我在想下面的例子


例如:

0001

0002

... 。

....

9999

A000

A001

A002 < br $> b $ b ....

....

Aa00

Aa01

Aa02

....

....

Ab00

Ab01

Ab02

....

....

Az00

Az01

Az02

....

....

B000

B001

....

....

....

....

Ba00

Ba01

....

....

Bb ..


我这样说可能是我不富裕的999,999但是至少我

会得到

Id不会有300,000左右这将是好吧,我。


我尝试在短时间内将代码实施到你的代码上,但我发现我没有资格扩展到找到答案的



我也在思考g使用某种编码方法将六位数字
整数转换为只有4的lentgh的字母数字数据。


但我不知道在哪里开始。我搜索网络,我找不到

任何好的文章或例子。


一篇关于随机字母数字字符串生成的文章使用随机化

methot来生成密码。但是我的回答不是那个。


说如果在报告中看到一个字母数字字符,例如zza5那么我将

必须转换为6位整数。但我的主要目标是知道取6

数字整数并转换为字母数字字符,其中lenthf为4,而

反之亦然。

我希望你能再帮我一次。


我感谢你的回复。


Rgds,

Niyazi


Hi all,

I have a integer number from 1 to 37000. And I want to create a report in
excel
that shows in 4 alphanumeric length.

Example:
I can write the cutomerID from 1 to 9999 as:
1 ----> 0001
2 ----> 0002
.....
.....
9999 ----> 9999

and I want to write the

10000 -----> as A000
10001 -----> as A001
.....
.....
.....
11000 -----> as B000
11001 -----> as B001

Does anyone knows easiets way to achive this?

Rgds,
Niyazi
I thank you kindly for reading my post.

解决方案

Hello, Niyazi,

There are probably many ways. One is:

Dim chraPrefix As Char() = "0123456789" & _
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Dim strID = chraPrefix(Int(intID / 1000)) & _
(intID Mod 1000).ToString("000")

Whether this is the easiest (or best) I couldn''t say.

But what do you want to have happen when cutomerID > 35999?

Cheers,
Randy
Niyazi wrote:

Hi all,

I have a integer number from 1 to 37000. And I want to create a report in
excel
that shows in 4 alphanumeric length.

Example:
I can write the cutomerID from 1 to 9999 as:
1 ----> 0001
2 ----> 0002
....
....
9999 ----> 9999

and I want to write the

10000 -----> as A000
10001 -----> as A001
....
....
....
11000 -----> as B000
11001 -----> as B001

Does anyone knows easiets way to achive this?

Rgds,
Niyazi
I thank you kindly for reading my post.



Hi Randy,

Thank you for your kind reply. Your solution works for me for a while, but
you are right. Now I am also wondering if the ID number riches 6 digits say
112007. And I have to convert to alphanumeric that has only length of 4.

I guess I have to put 10000 division as well as "0000" but I realy don''t
know how to implement into your previous answer.

I am realy sorry to say that is it possible to rearrange your code that
converts upto 6 digits number in alphanumeric character that has length of 4.

I very glad that you response very quickly.

Thank you.

Rgds,
Niyazi

"R. MacDonald" wrote:

Hello, Niyazi,

There are probably many ways. One is:

Dim chraPrefix As Char() = "0123456789" & _
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Dim strID = chraPrefix(Int(intID / 1000)) & _
(intID Mod 1000).ToString("000")

Whether this is the easiest (or best) I couldn''t say.

But what do you want to have happen when cutomerID > 35999?

Cheers,
Randy
Niyazi wrote:

Hi all,

I have a integer number from 1 to 37000. And I want to create a report in
excel
that shows in 4 alphanumeric length.

Example:
I can write the cutomerID from 1 to 9999 as:
1 ----> 0001
2 ----> 0002
....
....
9999 ----> 9999

and I want to write the

10000 -----> as A000
10001 -----> as A001
....
....
....
11000 -----> as B000
11001 -----> as B001

Does anyone knows easiets way to achive this?

Rgds,
Niyazi
I thank you kindly for reading my post.



Hi Randy,

I am sure ID number will not reach the 1,000,000 point. But if I have a
integer number between 1 to 999,999 then is it possible to convert starting
from
0001 (zero, zero, zero one) up to zzzz. After riches ZZZZ than have to start
something like aaaa. Or I am thinking like below example

Example:
0001
0002
....
....
9999
A000
A001
A002
....
....
Aa00
Aa01
Aa02
....
....
Ab00
Ab01
Ab02
....
....
Az00
Az01
Az02
....
....
B000
B001
....
....
....
....
Ba00
Ba01
....
....
Bb..

I am gussing this way may be I am not riching the 999,999 but at least I
will get
Id no around 300,000 and that will be okay with me.

I try to implement in short time above example to your code, but I find I am
not qualified that extend to find the answer.

I am also thinking to use some kind encoding method that converts six digit
Integer number into alphanumeric data that has only lentgh of 4.

But again I am not sure where to start. I search the net and I couldn''t find
any good article or example.

One article about "Random Alphanumeric String Generation" uses the randomize
methot to genereate a password. But I my answer wasn''t in that.

Say If see a alphanumeric charecter in the report such as zza5 then I will
have to convert into 6 digit integer. But my main goal is know to take the 6
digit integer and convert to alphanumeric characters that has lenthf of 4 and
vice-versa.

I hope you can help me one more time.

I thank you for your kind response.

Rgds,
Niyazi


这篇关于紧急!如何将10000转换为A000的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆