Solved

Excel Copy Text Box to cell

Posted on 2015-01-19
2
338 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

617 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