Solved

Excel Copy Text Box to cell

Posted on 2015-01-19
2
279 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

739 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