,  , VBA
> > Basic > VBA

 
 
 
 4.94/17:  :  - 17,   - 4.94
Namerz
0 / 0 / 0
: 06.11.2013
: 2
1

06.11.2013, 23:45. 3398. 29
( )

?
, "", ""
0
? .
Similar
41792 / 34177 / 6122
: 12.04.2006
: 57,940
06.11.2013, 23:45
:


. ...


. . ( ). ...

+
, . ...


, "" ( ...


: ...

29
Igor_Tr
4369 / 653 / 36
: 17.01.2010
: 2,134
07.11.2013, 20:11 21
to Ksyun.
... InStr)
. Mid . Aksima , , . Mid , , -
0
07.11.2013, 20:19 22
Ksyun
, ,
1
Ksyun
6 / 0 / 0
: 06.11.2013
: 29
07.11.2013, 20:22 23
))
0
Igor_Tr
4369 / 653 / 36
: 17.01.2010
: 2,134
07.11.2013, 22:37 24
To Aksima. ...
To Ksyun. Aksima Dictionary. . . , / ( .. , , ) . ( Hugo ...)
Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Sub ChrViaDict()
Dim mStr$, i&
   mStr = InputBox("WRITE  DOWN  ANY  EXPRESSION:", , "oagbd#lkks9ooocwboo,lmeifo10z")
   With CreateObject("scripting.dictionary")
      For i = 1 To Len(mStr)
         If Not .exists(Mid(mStr, i, 1)) Then .Add Mid(mStr, i, 1), i Else _
                     .Item(Mid(mStr, i, 1)) = .Item(Mid(mStr, i, 1)) & ";;;" & i
      Next
      mStr = InputBox("WRITE  DOWN  THE LETTER  YOU  ARE  INTERESTED:", , "o")
      If .exists(mStr) Then
          MsgBox "Position(s) of the letter" & Space(1) & mStr & ":" & Chr(13) & Chr(13) & _
            Replace(.Item(mStr), ";;;", ";" & Space(1), 1)
               Else: MsgBox "Not found"
      End If
   End With
End Sub


52
, Aksima!!! , - . - , Regular ( ) . ( - , )

16
msgbox. .
1
5845 / 1266 / 188
: 12.12.2012
: 989
07.11.2013, 23:19 25
Igor_Tr
- , Regular ( ) .
. - Regular , :

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Sub ChrViaRgEx()
    Dim pos As Long, l As String, s As String, msg As String
    Dim rgX As Object, mc As Object, m As Object
    'Ç*ïð*øèâ*åì ä***ûå.
    l = InputBox("Ââåäèòå áóêâó, êîòîðóþ *óæ*î **éòè:", "Áóêâ*", "o")
    s = InputBox("Ââåäèòå ñòðîêó, â êîòîðîé âû õîòèòå îñóùåñòâèòü ïîèñê áóêâû", "Ñòðîê*", "oagbd#lkks9ooocwboo,lmeifo10z")
    'Ñîçä*åì îáúåêò, ç**èì*þùèéñÿ ***ëèçîì ðåãóëÿð*ûõ âûð*æå*èé.
    Set rgX = CreateObject("VBScript.RegExp")
    rgX.Global = True 'Èùåì â ç*ä***îé ñòðîêå âñå ïîäñòðîêè, ñîîòâåòñâóþùèå ø*áëî*ó.
    rgX.Pattern = l & "|[^" & l & "]+" 'Ø*áëî* ïîèñê* - ëèáî ç*ä****ÿ áóêâ*, ëèáî ñòðîê* áåç ç*ä***îé áóêâû.
    Set mc = rgX.Execute(s) 'Ïîëó÷*åì êîëëåêöèþ ïîäñòðîê, ñîîòâåòñâóþùèõ ø*áëî*ó.
    For Each m In mc 'Îáð*á*òûâ*åì ïîëó÷å**óþ êîëëåêöèþ ñ ïîëó÷å*èåì ïîçèöèé ç*ä***îé áóêâû.
        pos = pos + Len(m)
        If m = l Then msg = msg & "; " & pos
    Next m
    'Âûâîä ðåçóëüò*ò*.
    If Len(msg) Then MsgBox "Ïîçèöèÿ(è) áóêâû """ & l & """: " & Mid(msg, 3) Else MsgBox "Áóêâ* """ & l & """ *å **éäå**."
End Sub
,
Aksima
1
Igor_Tr
4369 / 653 / 36
: 17.01.2010
: 2,134
07.11.2013, 23:27 26
. Sorry!!! ... ...
0
toiai
3099 / 890 / 195
: 29.05.2010
: 1,916
09.11.2013, 12:51 27
:
Visual Basic
1
2
3
4
5
6
7
8
9
10
11
Sub pr()
    Dim msg$, i&, b$, s, Stroka$, pos&
    b = "î"
    Stroka = "Còðîê*, â êîòîðîé âû õîòèòå îñóùåñòâèòü ïîèñê áóêâû"
    s = Split(Stroka, b)
    For i = 0 To UBound(s) - 1
        pos = pos + Len(s(i)) + len(b)
        msg = msg & IIf(i = 0, "", "; ") & pos
    Next
    MsgBox (msg)
End Sub
1
Igor_Tr
4369 / 653 / 36
: 17.01.2010
: 2,134
09.11.2013, 12:54 28
.
0
Ksyun
6 / 0 / 0
: 06.11.2013
: 29
09.11.2013, 15:33 29
toiai
:
Visual Basic
1
2
3
4
5
6
7
8
9
10
11
Sub pr()
    Dim msg$, i&, b$, s, Stroka$, pos&
    b = "î"
    Stroka = "Còðîê*, â êîòîðîé âû õîòèòå îñóùåñòâèòü ïîèñê áóêâû"
    s = Split(Stroka, b)
    For i = 0 To UBound(s) - 1
        pos = pos + Len(s(i)) + len(b)
        msg = msg & IIf(i = 0, "", "; ") & pos
    Next
    MsgBox (msg)
End Sub
,, ?
0
toiai
3099 / 890 / 195
: 29.05.2010
: 1,916
09.11.2013, 16:19 30
, :
1. Split - "b"
2. Ubound - "s"
0
09.11.2013, 16:19
MoreAnswers
37091 / 29110 / 5898
: 17.06.2006
: 43,301
09.11.2013, 16:19


, . . ...

Word. ( )
, . . WWWWW ...

, ,
, ,...




:
30

- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
@Mail.ru