您好,请原谅我崎岖的英语。
Option Explicit
Public GlbVarBaseSheet As String
------------
Sub Formularaufruf_Worksheet1()
GlbVarBaseSheet = ActiveSheet.Name
with Userform1
.MultiPage1.Value = 1
.Show 0
End With
End Sub
在Userform中,有一个Sub Subled Uebernahme,它填写文本框,读取存储在TextBox .tag中的列号。
如何使用此行中的工作表变量在Userform会话期间使用:这不起作用,我不知道为什么
With Workbooks("KVP.xlsm").Worksheets(GlbVarBaseSheet)
Full Sub:
Sub Uebernahme()
Dim Zeilenindex As Long
Dim OBcB As MSForms.Control
Dim VarTypeName As String
Sheets(GlbVarBaseSheet).Activate
'
'
'
Workbooks("KVP.xlsm").ActiveSheet.Rows(spinbutton1.Value).Activate
Zeilenindex = spinbutton1.Value
'
'
With Workbooks("KVP.xlsm").Worksheets(GlbVarBaseSheet)
If .Cells(ActiveCell.Row, 1).Value <> "" Then
For Each OBcB In MultiPage1.SelectedItem.Controls
VarTypeName = TypeName(OBcB)
If OBcB.Tag <> "" Then
Select Case VarTypeName
Case Is <> "Checkbox"
'OBcB.Value = .cells(Left(OBcB.Tag, 1) & ActiveCell.Row)
OBcB.Value = .Cells(ActiveCell.Row, Int(Left(OBcB.Tag, 1))).Value
End Select
End If
Next
End If
End With
End Sub
提前致谢
答案 0 :(得分:0)
尝试
dim GlbVarBaseSheet as Worksheet