command button 1 creates my textbox (named textbox1 according to the properties window). Adding - TextBox1.value = sheet2.range("j7").value - generates run-time error '424', object required.
command button 2 = TextBox1.cut
command button 1 creates my textbox (named textbox1 according to the properties window). Adding - TextBox1.value = sheet2.range("j7").value - generates run-time error '424', object required.
command button 2 = TextBox1.cut
Try this:
Private Sub CommandButton1_Click()
'delete tb if it exists
On Error Resume Next
ActiveSheet.TextBoxes("TextBox1").Delete
On Error GoTo 0
'create tb
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, _
120, 110, 210, 100).Select 'size the tb with the 4 #s
Selection.Name = "TextBox1"
Selection.Characters.Text = _
Sheet1.Range("A25").Value 'change depending on user input
End Sub
Hope that helps.
-Chris
"by1612" wrote:
>
> command button 1 creates my textbox (named textbox1 according to the
> properties window). Adding - TextBox1.value = sheet2.range("j7").value
> - generates run-time error '424', object required.
>
> command button 2 = TextBox1.cut
>
>
> --
> by1612
> ------------------------------------------------------------------------
> by1612's Profile: http://www.excelforum.com/member.php...fo&userid=8611
> View this thread: http://www.excelforum.com/showthread...hreadid=555976
>
>
Thanks Chris! Works great.
I'm sorry, it seems that each successful step leads to new questions. The generated text box (Text Box1) has a 256 character maximum, with set character size, font, etc. I guess because of it's nature, the TB has no properties window that I can access. Where do I insert statements to change these properties?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks