Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Help with Syntax UserForm TextBox

Hit a brick wall with this one and I'm sure it's possible (just not
for me at the moment).

Code is directly from the KB article for copying text between
textboxes using the character method. The problem is that my
"CopyFrom" textbox is on a UserForm and the "CopyTo" textbox
is on the Active sheet.

UserForm is named "Amendment"
The textbox on the UserForm is TextBox2
The TextBox on the Activesheet is TextBox22

Coding below:

Sub TextBox_To_TextBox()
Dim x As Integer
Dim txtBox1 As TextBox, txtBox2 As TextBox
Dim theText As String
Set txtBox1 = ActiveSheet.DrawingObjects(1)
' Above should reference UserForm "Amendment", "TextBox2"
Set txtBox2 = ActiveSheet.DrawingObjects(2)
' Above should reference Activesheet(Textbox22)
For x = 1 To txtBox1.Characters.Count Step 250
theText = txtBox1.Characters(start:=x, Length:=250).Text
txtBox2.Characters(start:=x, Length:=250).Text = theText
Next
End Sub

Any help with this would be certainly appreciated.

Thanks,
John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Help with Syntax UserForm TextBox

Henry,

Thanks, but I still can't get it to work.
Will try a repost on a freash thread.

John

Henry wrote:

John,
Set txtBox1 = ActiveSheet.DrawingObjects(1)
' Above should reference UserForm "Amendment", "TextBox2"
won't reference the text box on Amendment as it's not on the activesheet but
on the userform.

Try this:

Sub TextBox_To_TextBox()
Dim txtBox1 As TextBox
Set txtBox1 = ActiveSheet.DrawingObjects(1)
' Above should reference Activesheet(Textbox22)
TxtBox1.Text = Amendment.TextBox2.Text

End Sub

HTH
Henry

"John Wilson" wrote in message
...
Hit a brick wall with this one and I'm sure it's possible (just not
for me at the moment).

Code is directly from the KB article for copying text between
textboxes using the character method. The problem is that my
"CopyFrom" textbox is on a UserForm and the "CopyTo" textbox
is on the Active sheet.

UserForm is named "Amendment"
The textbox on the UserForm is TextBox2
The TextBox on the Activesheet is TextBox22

Coding below:

Sub TextBox_To_TextBox()
Dim x As Integer
Dim txtBox1 As TextBox, txtBox2 As TextBox
Dim theText As String
Set txtBox1 = ActiveSheet.DrawingObjects(1)
' Above should reference UserForm "Amendment", "TextBox2"
Set txtBox2 = ActiveSheet.DrawingObjects(2)
' Above should reference Activesheet(Textbox22)
For x = 1 To txtBox1.Characters.Count Step 250
theText = txtBox1.Characters(start:=x, Length:=250).Text
txtBox2.Characters(start:=x, Length:=250).Text = theText
Next
End Sub

Any help with this would be certainly appreciated.

Thanks,
John


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
WordWrap a TextBox on a UserForm dcornett63 Excel Discussion (Misc queries) 2 April 22nd 10 09:35 PM
Add COUNTIF TO USERFORM TEXTBOX Richhall[_2_] Excel Worksheet Functions 4 September 16th 09 11:43 AM
Syntax for selecting a textbox within a chart? tenlbham Charts and Charting in Excel 4 April 25th 07 02:39 AM
userform textbox Phil Excel Worksheet Functions 5 January 16th 05 06:59 PM
Populating Textbox in UserForm Derek[_2_] Excel Programming 3 July 10th 03 10:41 PM


All times are GMT +1. The time now is 11:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"