⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 vb精彩编程希望大家有用
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3000
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   3000
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command3 
      Caption         =   "退出"
      Height          =   495
      Left            =   840
      TabIndex        =   2
      Top             =   2160
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "显示表格"
      Height          =   495
      Left            =   840
      TabIndex        =   1
      Top             =   1320
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "生成表格"
      Height          =   495
      Left            =   840
      TabIndex        =   0
      Top             =   480
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim x(1 To 4, 1 To 5) As Integer
Dim ex As New Excel.Application

Private Sub Command1_Click()
    Dim i As Integer
    Dim j As Integer
    Dim exwbook As Object
    Dim exsheet As Object
    
    Set exwbook = Nothing
    Set exsheet = Nothing
    Set exwbook = ex.Workbooks().Add
    Set exsheet = exwbook.Worksheets("sheet1")
    ex.Range("c4:g7").Value = x
    
    ex.Range("c3").Value = "表 格"
    ex.Range("d3").Value = " 春 天 "
    ex.Range("e3").Value = " 夏 天 "
    ex.Range("f3").Value = " 秋 天 "
    ex.Range("g3").Value = " 冬 天 "
    
    MsgBox "表格生成完毕!"
End Sub

Private Sub Command2_Click()
    ex.Visible = True
End Sub

Private Sub Command3_Click()
    ex.Quit
    Unload Me
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -