Send data from Excel cell into Text Box VB6 using VBA

FernandSelangor

New Member
Joined
Jul 30, 2014
Messages
1
Dear Gents,

Using this code I am able to send data in cell A10 into .txt file.
How do I to send the data in cell A10 into text box VB6?
Code:
[COLOR=#333333]Private Sub ScrollBar1_Change()[/COLOR]

<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit;">Dim Text As StringDim TextFile As String      Application.ScreenUpdating = False      TextFile = "C:\text.txt"      Open TextFile For Output As #1      Text = Worksheets("Sheet 1").Range("A10")      Print #1, Text      Close #1 </code>[COLOR=#333333]End Sub[/COLOR]


If you would test my code
1. Click developer tab button in excel.
2. Click Insert Control and choose Scroll Bar ( Active X control )
3. Right click the Scroll Bar and choose property
4. Set the linkedCell to A10 and set the limit data between 1 to 100
5. Right Click the Scroll Bar and choose view code
6. Copy and Paste my code
7. Make a .txt file in C drive and name it as Text.
8. You are pleased to slide the scroll bar and you will the data in cell A10 is transferred into text.

I would like to do the same thing but this time I would send the
data in cell A10 into text box VB6.

Kindly regards.
:confused:


 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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