Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1888|回复: 3

Function函数学习

[复制链接]
发表于 2012-6-4 06:55 | 显示全部楼层 |阅读模式
Function函数
函数实际是实现一种映射,它通过一定的映射规则,完成运算并返回结果。参数传递也两种:按值传递(ByVal)和按地址传递(ByRef)。如下例:
Function password(ByVal x as integer, byref y as integer) as boolean
If y=100 then y=x+y else y=x-y
x=x+100
if y=150 then password=true else password=false
End Function

Sub call_password ()
Dim x1 as integer
Dim y1 as integer
x1=12
y1=100
if password then ‘调用函数:1. 作为一个表达式放在=右端 ; 2. 作为参数使用
debug.print x1   
     end if
End sub

excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
 楼主| 发表于 2012-6-4 06:56 | 显示全部楼层
函数实际是实现一种映射,它通过一定的映射规则,
回复

使用道具 举报

发表于 2012-6-4 08:20 | 显示全部楼层
回复

使用道具 举报

发表于 2012-6-4 08:42 | 显示全部楼层
是自定义函数吧?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2025-8-16 05:11 , Processed in 0.187981 second(s), 6 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表