Transfering Text from and Activex Textbox in one sheet to another Activex Textbox in another sheet

Mcfg007

New Member
Joined
Mar 10, 2018
Messages
45
Hello

I am looking to transfer text from an Activex Textbox in one sheet to another Activex Textbox in another sheet?

Can anyone help?

Many thanks
 
Sorry, I forgot to change my test sheet name (Sheet3) to your actual sheet name (). In the code below, you need to change the Sheet3 to your sheet's actual name.
Code:
[CODE]Private Sub TextBox1_Change()
  Application.EnableEvents = False
  Sheets("[B][COLOR=#ff0000]Sheet3[/COLOR][/B]").TextBox1.Value = TextBox1.Value
  Application.EnableEvents = True
End Sub
[/CODE]

Right lets see if I understand as nothing is happening:

I have two sheets, one sheet (which is the source) called "Case Details" or Sheet2 with a textbox 1 and I have another sheet called "CI Report" with another texbox 1 where I want the text to appear.

I have double clicked the textbox1 on sheet"Case Details" in design mode and entered the code you provided as follows:

Private Sub TextBox1_Change()
Application.EnableEvents = False
Sheets("CI Report").TextBox1.Value = TextBox1.Value
Application.EnableEvents = True
End Sub

however nothing shows up on sheet "CI Report"

What am I missing here?
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Right lets see if I understand as nothing is happening:

I have two sheets, one sheet (which is the source) called "Case Details" or Sheet2 with a textbox 1 and I have another sheet called "CI Report" with another texbox 1 where I want the text to appear.

I have double clicked the textbox1 on sheet"Case Details" in design mode and entered the code you provided as follows:

Private Sub TextBox1_Change()
Application.EnableEvents = False
Sheets("CI Report").TextBox1.Value = TextBox1.Value
Application.EnableEvents = True
End Sub

however nothing shows up on sheet "CI Report"

What am I missing here?
I just tried it following the steps you outlined above and it works perfectly for me. I am at a loss why it is not working correctly for you. Any chance you can post a copy of your workbook on DropBox so I can download it and try to see what the problem is?
 
Upvote 0
I just tried it following the steps you outlined above and it works perfectly for me. I am at a loss why it is not working correctly for you. Any chance you can post a copy of your workbook on DropBox so I can download it and try to see what the problem is?

Rick, This is my email. Please send me a reply email and I will email you the workbook. Much appreciated.
 
Last edited by a moderator:
Upvote 0
@Mcfg007
I removed your email address from your post, as Spam Bots routinely troll Public User Forums like these looking for email addresses to Spam.
 
Upvote 0
Rick, This is my email. Please send me a reply email and I will email you the workbook. Much appreciated.
I sent you an email (before Fluff removed your email address) received your file. To keep this thread complete, I am posting here what I emailed back to you after testing your file...
I am not sure what to tell you as the code is working fine for me here. When I open the file you sent me and type text into the "Summary of key Evidence" TextBox on the "Case Details" sheet, that same text shows right up in the "Summary of Key Evidence" TextBox on the "CI Report" sheet. In other words, the code, as is, works as expected for me. I cannot think of a reason why this is not working for you. Something you may try... open the file on a different computer and see if it works for you then... just as an experiment. Let me know if it works or not when you do that.
 
Upvote 0
Hi

I get an error '1004' unable to set RowHeight property of the Range class. when I protected the sheet, can anyone tell me the way around this?
 
Upvote 0
I get an error '1004' unable to set RowHeight property of the Range class. when I protected the sheet, can anyone tell me the way around this?
You have to unprotect the sheet before you can make any changes to it. The way you do that in your code is by putting this line of code any time before your code attempts to change the sheet...

Sheets("YourSheetName").Unprotect "Password if any"

Omit the password if the sheet's protection does not have one... specify the sheet's name where I have highlighted in blue

At the end of your code, you need to reapply the protection using this...

Sheets("YourSheetName").Protect "Password if any".

If you have applied any conditions to your protection, you need to specify them as well. You will have to see the help files for the Protect method in order to know where to specify them.
 
Last edited:
Upvote 0
You have to unprotect the sheet before you can make any changes to it. The way you do that in your code is by putting this line of code any time before your code attempts to change the sheet...

Sheets("YourSheetName").Unprotect "Password if any"

Omit the password if the sheet's protection does not have one... specify the sheet's name where I have highlighted in blue

At the end of your code, you need to reapply the protection using this...

Sheets("YourSheetName").Protect "Password if any".

If you have applied any conditions to your protection, you need to specify them as well. You will have to see the help files for the Protect method in order to know where to specify them.


The only issue now is that the text enter on the first sheet active textbox does not update on sheet two box as original done. When I remove the code and unprotect the sheet it starts loading the text enter on the other sheet again.
 
Upvote 0
Rick. Much appreciated. It works perfectly!

It appears that the code removes the error 1004 code and works fine, however any data brought from another textbox no longer loads on the intended textbox. If I removed the codes and unprotect the sheets, it starts working fine again. So the ask is, how to get the code in without affecting the automatically loading of the boxes.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top