Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel Copy Text Box to cell

Posted on 2015-01-19
2
Medium Priority
?
419 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

719 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