REFRENCE A TEXTBOX ON A SHEET IN EXCEL 2000

  • Thread starter Thread starter Songoku
  • Start date Start date
S

Songoku

Hi

I have a text box on sheet 2 which I want to populate with results from 3
cells on sheet 1 new to VB and not sure how to go about this any help
appreciated. thnxs
 
Try

Sheets("Sheet2").TextBox1.Text = Sheets("Sheet1").Range("A1").Text

Mike
 
Ah,

You wanted 3 cells in the tectbox, maybe this instead

Sub marine()
With Sheets("Sheet1")
mystring = .Range("A1").Text & .Range("A2").Text & .Range("A3").Text
End With
Sheets("Sheet2").TextBox1.Text = mystring
End Sub

Mike
 
Hi,

Welcome to the world of Excel Programming !
1) Since you want the textbox to store the contents of 3 cells in Sheet1.
Assuming these 3 cells are(A1 , A2 & A3)
in Cell A4, add the formula =A1 & " " & A2 & " " & A3

2) In the design View, Right Click the TextBox, click Properties->
LinkedCell Field.
Enter "Sheet1!A4" (Without quotes)

Exit the design view, the value from A4 cell in sheet 1 will be displayed in
the textbox.

Cheers,
 
Ta Tausif....

should have mentioned that this is not a form, when I right click on the
text box I do not have what you mention below....it is a shape\text box which
is dragged onto a sheet
 
Thnks Mike

I tried the code you suggested (modified) however I get the following error
come up
"Runtime error 438 - object doesnt support this property or message"

any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top