Solved

Excel Copy Text Box to cell

Posted on 2015-01-19
2
214 Views
Last Modified: 2015-01-23
Hello Experts,

I'd like a sub routine to copy the text from a predetermined textbox into a cell on the current worksheet. The various textboxes will be on a separate worksheet.

1) There are several potential textbox choices, the textbox name will come from cell "b2". i.e. "RadiantText" or "InsulationText"

2) The contents of the textbox needs to be pasted into cell "d3"
0
Comment
Question by:bikeski
2 Comments
 
LVL 5

Expert Comment

by:Flora
ID: 40558994
here you go

Sub TextBoxes()
Dim tbx As OLEObject
For Each tbx In ActiveSheet.OLEObjects

If TypeName(tbx.Object) = "TextBox" Then
For i = 1 To 1000
tbx.Object.Text = Cells(i, 1).Value
Next i
End If
Next
End Sub

Open in new window

0
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 500 total points
ID: 40559024
Use this...

    Range("D3").Value = Worksheets("Sheet1").OLEObjects(Range("B2").Value).Object.Text

...where Sheet1 is the name of the worksheet containing your textboxes.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now