我想通过双击活动单元格,通过消息框或userform显示活动单元格中的所有内容。是否可以通过VBA?它必须根据单元格动态工作,因为每个单元格包含不同的句子。原因是句子太长,每次都因格式或视觉质量而难以打开。
答案 0 :(得分:0)
将其放在Sheet模块中:
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
MsgBox Target, , "Cell contents"
Cancel = True
End Sub
显示超过1024个字符
UserForm1
示例)
TextBox1
)TextBox1.MultiLine = True
和TextBox1.ScrollBars = 3 - FmScrollBarsBoth
并在Sheet模块中使用它:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
With UserForm1
.Caption = "Cell contents"
.TextBox1.Value = Target.Value
.Show
End With
Cancel = True
End Sub
UserForm1