我对 VBA 很陌生,我不知道如何在 subs 之间使用变量。代码应该是不言自明的:
Public Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim strWeapon As String
If Target.Address = "$I$8" Then
MsgBox "You pick up a sword"
strWeapon = "Sword"
ElseIf Target.Address = "$I$9" Then
MsgBox "You pick up a magic staff"
strWeapon = "Magic"
ElseIf Target.Address = "$I$10" Then
MsgBox "You pick up a bow and arrows"
strWeapon = "Bow"
End If
End Sub
Public Sub CommandButton1_Click()
If strWeapon = "Magic" Then
UserForm1.Show
ElseIf strWeapon = "Sword" Then
UserForm2.Show
ElseIf …Run Code Online (Sandbox Code Playgroud) 我有一个 bookdown 文档,它在我的本地机器上呈现得很好,但是当我使用 GitHub Actions 作为自动化进程运行时,来自各个代码块的输出显示全部混乱:

这是本书的 GitHub 存储库:https : //github.com/ries9112/cryptocurrencyresearch-org
这里是通过 GitHub Actions 自动运行的地方:https : //github.com/ries9112/cryptocurrencyresearch-org/actions
为了帮助解决问题,我创建了一个单独的存储库作为一个更加准系统的示例,并且我遇到了完全相同的问题。这是更简单示例的存储库:https : //github.com/ries9112/bookdown-test
我部署了那个更简单的测试的结果,你可以在这里找到它们:https : //brave-leakey-37b898.netlify.app/intro.html#here-adding-new-test

文档格式在本地完全没问题,所以看起来我可能需要安装其他东西,但我目前正在安装 pandoc 和 tinytex,我不知道还有什么可能会丢失。这是定义 GitHub 操作的 YAML 文件:
jobs:
build:
runs-on: macOS-10.15
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
- name: Install pandoc and pandoc citeproc
run: |
brew install pandoc
brew install pandoc-citeproc
- name: Install Packages
run: |-
Rscript -e "install.packages(c('pins','bookdown','tidyverse','DT'))"
- name: Refresh book
run: |-
Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::gitbook')" …Run Code Online (Sandbox Code Playgroud)