- ©«¤l
- 396
- ¥DÃD
- 12
- ºëµØ
- 0
- ¿n¤À
- 425
- ÂI¦W
- 1
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¤¤
- µù¥U®É¶¡
- 2013-7-2
- ³Ì«áµn¿ý
- 2024-8-23
|
¦^´_ 1# dechiuan999
¦]¬°VBA¸Ì±ªºTRIM¡A¦ü¥G¥u·|¥h®ø°£ÀY§ÀªºªÅ¥Õ®æ¡A¤å¦r¤¤¶¡ªºªÅ¥Õ®æ¤£²z·|¡C
¦ÓEXCEL¨ç¼Æ¸ÌªºTRIM«h¥i¥H³B²z³oÓ°ÝÃD¡C
©Ò¥H§A¥un¦b¤GÓTRIMªº«e±¥[Ó¡yAPPLICATION.¡z¡A°ÝÃD´N¸Ñ¨M¤F¡C- Sub aa()
- Dim mSht1 As Worksheet
- Dim mRng As Range, mRng1 As Range
- Dim mStr1$, mStr2$
-
- Set mSht1 = Worksheets(1)
- With mSht1
- Set mRng1 = .Range("a2", .Range("a" & .Rows.Count).End(xlUp))
- For Each mRng In mRng1
- mStr1 = Application.Trim(mRng.Value)
- mStr2 = Application.Trim(mRng.Offset(, 1))
- mRng.Offset(, 2) = IIf(StrComp(mStr1, mStr2, vbTextCompare) = 0, "TRUE", "FALSE")
- Next
- End With
- End Sub
½Æ»s¥N½X |
|