VBA Excel口算题

口算题函数

利用随机数写个20以内加减法口算题函数

vbscript 复制代码
Function Kousuan()
    Dim intOne As Integer
    Dim intTwo As Integer
    Dim strFlg As String
    Dim intFlg As Integer
    Dim strRtn As String
    
    intFlg = Application.WorksheetFunction.RandBetween(0, 1)
    strFlg = "-"
    If intFlg = 0 Then strFlg = "+"
    
    intOne = Application.WorksheetFunction.RandBetween(10, 20)
    intTwo = Application.WorksheetFunction.RandBetween(1, 20)
    
    If strFlg = "-" Then
        If intOne > intTwo Then
            strRtn = intOne & strFlg & intTwo & "="
        Else
            strRtn = intTwo & strFlg & intOne & "="
        End If
    Else
        strRtn = intOne & strFlg & intTwo & "="
    End If
    
    shuxue = strRtn
End Function
相关推荐
oennn欧冷10 天前
中文关键字检索分析-导出到csv或者excel-多文件或文件夹-使用python和asyncio和pandas的dataframe
python·pandas·vba·asyncio·dataframe·completablefuture
rousseaou812 天前
Weibull概率分布纸(EXCEL VBA实现)
excel·vba·weibull·weibull概率纸·可靠性理论
Script_Man14 天前
VBA进行excel坐标转换
算法·自动化·vba·坐标转换·combobox·excel画图
jOkerSdl22 天前
在VBA中,对Excel单元格的操作方法 (qo+op)
excel·vba
jOkerSdl1 个月前
在VBA中调用Adobe Acrobat或Reader的命令行工具,实现PDF自动打印 (‾◡◝)
pdf·vba
营赢盈英1 个月前
OpenAI API VBA function returns #Value! but MsgBox displays response
ai·excel·vba·openai api·worksheet
菌王1 个月前
多种办公功能的WORD VBA程序
开发语言·人工智能·word·vba
专注VB编程开发20年1 个月前
如何用vba把word中的图片导出为独立的图片格式文件?
word·vba·导出图片
wuchunyu0021 个月前
VBA 指定快捷键在Excel中粘贴指定缩放图片
vba
jOkerSdl1 个月前
在Excel中启用宏 (~ ̄▽ ̄)~
excel·vba