VBA application tips

Source: Internet
Author: User

Recently I have been learning Excel macros and applied them to VBA. VBA has very powerful functions and is easy to learn.If you are interested, you can study with me. If you have good learning documents, I hope you can introduce them to me.

You must add a value for the floating point value.F:

You must add a value for the floating point value. F To indicate that this is a floating point number, otherwise it will be treated Double To process, similar VBA In & H 1a 16 Hexadecimal Representation
Private void showfloatvalue ()
{
Float var;
Var = 0.42f ;// Note:
Value. Text =" 0.42f ";
}

for modulus (remainder) % :

VBAChina siteX mod yTo modulo,C #China siteX % YModulo (remainder)

I = I + 1 Use now I ++ Or ++ I To indicate, I = I + Use now I + = To indicate:

I = I + 1Use now I ++ Or ++ I To indicate, I = I + Use now I + = To indicate
VB Code: I = I + 1
C # Code: I ++ Or ++ I To indicate
VB Code: I = I-1
C # Code: I -- Or -- I To indicate

X ++The generated value is before the increment occurs.XValue, while++ XThe generated value is incremental.XValue. For example, see:

Int x
X = 42;
Console. writeline (x ++); // XEqual43, The output is42
X = 42;
Console. writeline (++ X); // XEqual43, The output is43

 

Take the absolute value ( ABS ), Round ( Int ), Rounding ( Round )

 

 

Note: Some documents of others are reproduced in the content. Note :) 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.