提问人:Tim Masters Sr. 提问时间:6/8/2023 最后编辑:ProgmanTim Masters Sr. 更新时间:6/9/2023 访问量:17
我正在使用形状和 excel 表单创建预订工作表。我想在表单中使用形状的名称作为标识符
I'm creating a booking worksheet using shapes and an excel form. I want to use the name of the shape as an identifier in the form
问:
Sub MyShape_Click()
Dim sh As Shape
Set sh = ActiveSheet.Shapes(Application.Caller)
sh.Fill.ForeColor.RGB = RGB(0, 0, 255)
If MsgBox("This will confirm the reservation! Are you sure?", vbYesNo, "Reservation") = vbNo Then Exit Sub
sh.Fill.ForeColor.RGB = RGB(255, 0, 0)
CallingShapeName = ActiveSheet.Shapes(Application.Caller).Name
MsgBox CallingShapeName
Call Reservations
End Sub
Sub Reservations()
If ActiveSheet.Name = "Reservations" Then
Sheets("Form").Activate
Else
Sheets("Reservation").Activate
End If
Range("E" & Rows.Count).End(xlUp).Offset(1).Select
'Show the default data entry form
ActiveSheet.ShowDataForm
End Sub
我不知道如何将形状的名称粘贴到“保留”中的单元格中。
答: 暂无答案
评论