|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Does anybody know an equivalent to the GetChar function used in visualbasic.net for excel 2000. Or at least which reference to use. Thanks.
|
|
#2
|
|||
|
|||
|
Out of curiosity, what does the GetChar function do?
lwells |
|
#3
|
|||
|
|||
|
From what I saw it takes any character withing a string. For example
Dim word As String Dim letter As Char Word = "NAMES" letter = GetChar(word, 4) 'Letter = E I think it is only availiable in newer versions of VB though. |
|
#4
|
|||
|
|||
|
I think this would be a similar function
Function GetChar(strWord As String, n As Integer) On Error GoTo Err_Handler Dim i As Integer Dim pos As Integer Dim strReturn As String Dim strLetterCount As Integer i = 1 pos = InStr(i, strWord, "") strLetterCount = 0 Do While pos <> 0 strReturn = Mid(strWord, i, 1) strLetterCount = strLetterCount + 1 If strLetterCount = n Then Exit Do i = pos + 1 pos = InStr(i, strWord, "") Loop If strLetterCount = n Then GetChar = strReturn Else GetChar = "" End If Exit Function Err_Handler: MsgBox Err.Number & " " & Err.Description Resume Next End Function GetChar("NAMES",4) will return the letter E See if this is what you were asking. lwells |
|
#5
|
|||
|
|||
|
Thanks once again
![]() |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Quick Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|