- ©«¤l
- 231
- ¥DÃD
- 55
- ºëµØ
- 0
- ¿n¤À
- 293
- ÂI¦W
- 0
- §@·~¨t²Î
- winxp
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- KEELUNG
- µù¥U®É¶¡
- 2010-7-24
- ³Ì«áµn¿ý
- 2018-8-28
|
¥»©«³Ì«á¥Ñ dechiuan999 ©ó 2012-6-17 13:52 ½s¿è
ÁÂÁª©¥D¤j¤jªº«üÂI¡C
ª½±µ¨Ï¥ÎREPLACE¨ç¼Æ¥i´£¤É
¥\¯à©Ê¡C¨º¬O§_¦³¤èªk¥i¨Ï¥Î
·Æ¹«ª½±µ¿ï¨úTextbox1.Textªº¬Y¤@³sÄò¦r¦ê
¨Ã¾É¤J¦ÜTextbox2.text¦Ó¤£¥²¿é¤J
n§ó´«ªº¦r¦ê©O¡H
¤U¦C¬O¤p§Ì¥t¤@²©öªºªí³æ
ComboBox1¡÷«ü©wn´À´«¦r¦êªº¦¸¼Æ
Textbox1 ¡÷¥ÑÀx¦s®æ¶Ç¤Jªº¦r¦ê
Textbox2 ¡÷¯à§_¥Ñ·Æ¹«¿ï¨úTextbox1ªº¬Y¤@³sÄò¦r¦ê¨Ã¾É¤J¦ÜTextbox2©O¡H
Textbox3 ¡÷«ü©wn§ó´«ªº¦r¦ê¡A¶·¥ÑÁä½L¿é¤J¦r¦ê
Private Sub CommandButton1_Click()
Dim mTxt1$, mTxt2$, mTxt3$
Dim C1%
C1 = ComboBox1.Value '«ü©wn´À´«¦r¦êªº¦¸¼Æ
mTxt1 = TextBox1.Text '¥ÑÀx¦s®æ¶Ç¤Jªº¦r¦ê
mTxt2 = TextBox2.Text '¯à§_¥Ñ·Æ¹«¿ï¨úTextbox1ªº¬Y¤@³sÄò¦r¦ê¨Ã¾É¤J¦ÜTextbox2©O¡H
mTxt3 = TextBox3.Text '«ü©wn§ó´«ªº¦r¦ê¡A¶·¥ÑÁä½L¿é¤J¦r¦ê
mTxt1 = Replace(mTxt1, mTxt2, mTxt3, 1, C1, vbTextCompare) 'ª½±µ¤Þ¥ÎReplace¨ç¼Æ,逹¦¨½s¿è¡Bקï¡B§R°£¡B´À´«¡C
TextBox1.Text = mTxt1
Range("A1") = TextBox1.Text
End Sub
Private Sub UserForm_Initialize()
TextBox1.Text = "ABCDEFG1234D5D6"
With ComboBox1 '
.AddItem "1"
.AddItem "2"
.AddItem "3"
.Value = 1
End With
End Sub |
-
-
test.rar
(6.99 KB)
|