Mid function invocation of VB

Updated on technology 2024-03-14
5 answers
  1. Anonymous users2024-02-06

    mid(string a, start looking for the bit value (data b), find the number of digits (data c)) Your function looks like this.

    For example: mid("asdfgwww",2,3) is to start from the second bit of the string, take 3 characters, and the result is dfg and instr

    function to find where a string first appears in another string.

    Form: instr([start,string1,string2[,compare])

    instr(1,"kl-k-kp","k"), that is, in kl-k-kp to find the position where k appears from the first position, the result is 1,instr(2,"kl-k-kp","k"), that is, in kl-k-kp, find the position where k appears from the 2nd position, and the result is 4,

  2. Anonymous users2024-02-05

    Look at your buffer is a variable, I'll explain.

    Let's say buffer="abc7fdefg7ff".

    instr(1,buffer,"7f"+2 means to look up "abc7fdefg7ff" from the first digit"7f"Note that there are two of them"7f"Then the first one is returned"7f"The position of 7 is 4 plus 2, and the result is 6 (to return the second one.)"7f"You need to know the first position, and then change 1 to that number + 1, for example, if this problem is like this, instr(5,buffer,"7f"is to look for the next one"7f"The method is also if this character is not in the river"7f"Then return 0).

    Then mid(buffer,instr(1,buffer,"7f"+2,2) is mid(buffer,6,2), which means that "abc7fdefg7ff" starts with the 6th digit, which means that the result is "de".

    Then mid(buffer,instr(1,buffer,"7f"+4,2) is mid(buffer,8,2), which means that "abc7fdefg7ff" starts with the 8th digit, which means that the result is "fg".

  3. Anonymous users2024-02-04

    mid("thisisa

    book",3,2) know it (for is), instr(1,"thisisa

    book","is") = 3, 1 means to start with the first character and return"thisisa

    book"for the first time"is"Location, now easy to understand :

    mid(buffer,instr(1,buffer,"7f") +4, 2) indicates the first occurrence in the buffer"7f"The position is shifted back by four (+4) after two characters.

  4. Anonymous users2024-02-03

    1. Open an excel file and enter some strings in **, such as learning a Tang poem, as shown in the figure below.

    2. Then, left-click the [Development Tools] menu tab, in the VBA control drop-down menu, and select the button control of the form, as shown in the following figure.

    3. Then, draw out the form button control in **, and modify the control name, such as using the MID function, and left-click the [View**] button, as shown in the following figure.

    4. Then, enter the vba statement in the ** window, enter the statement that defines the variable, and assign the variable value, as shown in the following figure.

    5. Then, enter the position of the cell in the ** window, and enter the answer width and missing MID function, as shown in the following figure.

    6. Then, in the parameters of the MID function, enter the value range of the string, as shown in the following figure.

    7. Finally, on the design window, click the button with the left mouse button, and you can see the cell in **, showing the string data of a Tang poem, as shown in the figure below. Through this operation, you will learn to use the MID function of VBA to assign values to cells.

  5. Anonymous users2024-02-02

    mid is to take a substring from a string, such as a="aabbcc", we want to take it out"bb"You can use mid("aabbcc",3,2)

    MID has 3 parameters, the first parameter is which string to take from, and the second parameter refers to the number of points to take.

    The third parameter refers to how many to take.

    For example: mid("aabbcc", 3, 2) refers to the following"aabbcc"starts with 2 characters, so the return value is"bb".

Related questions
9 answers2024-03-14

The decimal part of the date variable with a value of less than 1 corresponds to the time of day from 0:00:00 to 24:00:00 >>>More

6 answers2024-03-14

I tried going downstairs with no problem. If it can't be opened, the landlord can try this sentence: (note that it is 3 quotation marks). >>>More

3 answers2024-03-14

Your first one is not a loop statement.

private sub form_click()if i = 0 then >>>More

6 answers2024-03-14

The second line declares that the textbox control array ** is wrong and does not conform to the syntax specification! >>>More

5 answers2024-03-14

Try my way:

Create a text on the form, and a command1 >>>More