小编yab*_*b86的帖子

运行时错误6 - 如何使Mod处理双精度?

我在vba中总是遇到运行时错误:

 Sub rsa()

Dim c1 As Long
Dim c2 As Long
Dim z As Long
Dim e As Long

pt = "xa"
n = 187
e = 7

For i = 1 To Len(pt)

    b = Mid$(pt, i, 1)

        If b <> " " Then

             z = Asc(UCase(b))
             'Here is the problem:
             c = z ^ e Mod n
             Text = Text & c

        Else

        Text = Text & " "

        End If

Next i
Cells(20, 4).Value = Text
End …
Run Code Online (Sandbox Code Playgroud)

excel vba excel-vba

6
推荐指数
1
解决办法
3232
查看次数

根据十六进制值设置单元格的背景颜色

我想根据另一个单元格中的十六进制值将背景颜色设置为一个单元格。到目前为止我所做的:

function setColorHEX(hex) {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var cell = ss.getActiveCell();
  cell.setBackground(hex);
}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

有人知道我做错了什么吗?

google-sheets google-apps-script custom-function google-sheets-formula

3
推荐指数
1
解决办法
1万
查看次数