将单元格范围加载到单个表单文本框中

我正在使用MSO Excel 2013,我试图加载一个窗体中的单个文本框的单元格的范围。 这是我正在写的帮助文件。 只要我加载1个单元格,它工作正常。 当我尝试加载一系列单元格时,出现错误。 有没有办法做到这一点? 我的代码如下:

Private Sub cmbTopic_Change() Me.lblTopic.Caption = Me.cmbTopic.Value Select Case Me.lblTopic.Caption Case Is = "Understanding The Software" Me.txtHelp.Text = Worksheets("HelpFile").Range("A2").Text Case Is = "First Time Use" Me.txtHelp.Text = Worksheets("HelpFile").Range("B2").Text Case Is = "General Instructions" 'this is where I'm getting an error Me.txtHelp.Text = Worksheets("HelpFile").Range("C2:C4").Text End Select End Sub 

您将需要构build一个单元格值的string,然后将其写入文本框。

你可以尝试这样的事情…

 Dim Cell As Range For Each Cell In Sheet2.Range("C2:C4") If Str = "" Then Str = Cell.Value Else Str = Str & vbCrLf & Cell.Value End If Next Cell Me.txtHelp.MultiLine = True Me.txtHelp.Value = Str