Transfer of data between sheets

jbadger

New Member
Joined
Aug 25, 2016
Messages
5
I am looking for a way to transfer data between two different sheets. All are ActiveX controls. On Sheet1 there is a textbox and a button. On Sheet2 there is another textbox. When the button is pushed on Sheet1, it should take the string in textbox1 and copy it to the text box on Sheet2. Nothing happens when the button is pushed (the text in textbox2 does not change). To simplify the debugging, I have simplified the VBA (simple "mary" constant string) to try the following [test.xlsm - Sheet1 (Code) ]:

Private Sub btnPerson_Click()
Sheet2.OLEObjects("tbBox2").Object.Text = "mary"
End Sub
Have also tried:
Private Sub btnPerson_Click()
Worksheets("Sheet2").OLEObjects("tbBox2").Object.Text = "mary"
End Sub

No change in textbox2 ("mary" did not appear in textbox2 and no debugging/compile error either). It works when the copying is done all on the same sheet.


Will eventually like to change to:

Sheet2.OLEObjects("tbBox2").Object.Text = tbBox1.Text
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
It works for me
Make sure your button name is btnPerson, rather than the caption
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,741
Messages
6,126,587
Members
449,319
Latest member
iaincmac

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