Excel VBA实现的简单电子病历管理
界面示例
主界面只放了两个button,用Excel自带的筛选功能进行检索
新建病例
Sub 新建病例()
'
'
'
Dim i As Integer
Dim temp As Integer
Dim error As String
Dim display As String
Dim myButtons As Integer
Dim myTitle As String
Dim myChoice As Integer
Dim sheetsName As String
Dim town As String
i = 3
Do While Cells(i, 1).Formula <> "" And i < 2000
i = i + 1
Loop
If i >= 2000 Then
error = "错误:病历数已达上限!"
myTitle = "错误"
myButtons = vbOKOnly + vbExclamation
MsgBox error, myButtons, myTitle
ElseIf i > 2 Then
myTitle = "新建病历"
display = "请输入患者姓名"
town = InputBox(prompt:=display & Chr(13), Title:=myTitle, Default:="")
If town <> "" The