Excel用户表单 [英] Excel User Forms

查看:91
本文介绍了Excel用户表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过在Excel中创建用户表单来查看数据表,导航和搜索记录,编辑现有记录以及添加新记录等方式。
我'我设法在Lynda.com上找到一个用户表单添加新记录到数据表的方法,但找不到我需要的其他vba命令的任何可用信息。 

这里是到目前为止我所拥有的:

Private Sub CmdAddData_Click()



Dim lngRow As long



工作表("Sheet1")。激活

lngRow =工作表("Sheet1")。范围("A1048576")。结束(xlUp).Row + 1



Cells(lngRow,2)= CheckBox1.Value

Cells(lngRow,3)= CBxYear.Value

单元格(lngRow,4)= CBxMonth.Value

单元格(lngRow,5)= CBxDay.Value

单元格(lngRow,10)= TxtProgramme.Value

Cells(lngRow,11)= TxtVenue.Value

Cells(lngRow,12)= TxtMemo.Value

Cells(lngRow,14)= CheckBox 2.Value

Cells(lngRow,15)= CheckBox3.Value

Cells(lngRow,16)= CheckBox4.Value

Cells(lngRow ,17)= CheckBox5.Value

Cells(lngRow,18)= CheckBox6.Value

Cells(lngRow,19)= CheckBox7.Value

Cells(lngRow,19)。激活



CheckBox1.Value = False

CBxYear.Value =""

CBxMonth.Value =""

CBxDay.Value =""

TxtProgramme.Value =""

TxtVenue.Value =""

TxtMemo.Value =""
$
CheckBox2.Value = False

CheckBox3.Value = False

CheckBox4.Value = False

CheckBox5.Value = False

CheckBox6.Value = False

CheckBox7 .Value = False

结束次级



私人子公司CmdCancel_Click()

FrmDataEntry.Hide

结束子

I’m muddling my way through creating a user form in excel to view a table of data, navigate and search through records, edit existing records and add new records.
I’ve managed to find a method on Lynda.com of Adding New Records to data table with a user form, but can’t find any usable information on the other vba commands I require. 
Here is what I have so far:
Private Sub CmdAddData_Click()

Dim lngRow As Long

Worksheets("Sheet1").Activate
lngRow = Worksheets("Sheet1").Range("A1048576").End(xlUp).Row + 1

Cells(lngRow, 2) = CheckBox1.Value
Cells(lngRow, 3) = CBxYear.Value
Cells(lngRow, 4) = CBxMonth.Value
Cells(lngRow, 5) = CBxDay.Value
Cells(lngRow, 10) = TxtProgramme.Value
Cells(lngRow, 11) = TxtVenue.Value
Cells(lngRow, 12) = TxtMemo.Value
Cells(lngRow, 14) = CheckBox2.Value
Cells(lngRow, 15) = CheckBox3.Value
Cells(lngRow, 16) = CheckBox4.Value
Cells(lngRow, 17) = CheckBox5.Value
Cells(lngRow, 18) = CheckBox6.Value
Cells(lngRow, 19) = CheckBox7.Value
Cells(lngRow, 19).Activate

CheckBox1.Value = False
CBxYear.Value = ""
CBxMonth.Value = ""
CBxDay.Value = ""
TxtProgramme.Value = ""
TxtVenue.Value = ""
TxtMemo.Value = ""
CheckBox2.Value = False
CheckBox3.Value = False
CheckBox4.Value = False
CheckBox5.Value = False
CheckBox6.Value = False
CheckBox7.Value = False
End Sub

Private Sub CmdCancel_Click()
FrmDataEntry.Hide
End Sub

我很感激任何帮助,即使它只是指向我正确的方向

I'd be grateful for any help even if its just to point me in the right direction

Tha nks

这也是一个我知道我的补充问题。关键字,并想知道在这种情况下是否相关或有用。

Also a supplementary question I’m aware of the Me. keyword and was wondering if it was relevant or useful in this case.

推荐答案

你好,

这个问题更适合Excel for developer论坛,并在那里移动这个问题,以便更好地了解该论坛中的专家。

This question is more suited to the Excel for developer forum and with that moving this question there for better visibility of the experts in that forum.


这篇关于Excel用户表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆