ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   REFRENCE A TEXTBOX ON A SHEET IN EXCEL 2000 (https://www.excelbanter.com/excel-programming/414440-refrence-textbox-sheet-excel-2000-a.html)

Songoku

REFRENCE A TEXTBOX ON A SHEET IN EXCEL 2000
 
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

Mike H

REFRENCE A TEXTBOX ON A SHEET IN EXCEL 2000
 
Try

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

Mike

"Songoku" wrote:

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


Mike H

REFRENCE A TEXTBOX ON A SHEET IN EXCEL 2000
 
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

"Mike H" wrote:

Try

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

Mike

"Songoku" wrote:

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


Tausif

REFRENCE A TEXTBOX ON A SHEET IN EXCEL 2000
 
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,
--
Tausif Mohammed


"Songoku" wrote:

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


Songoku

REFRENCE A TEXTBOX ON A SHEET IN EXCEL 2000
 
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


"Tausif" wrote:

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,
--
Tausif Mohammed


"Songoku" wrote:

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


Songoku

REFRENCE A TEXTBOX ON A SHEET IN EXCEL 2000
 
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?

"Mike H" wrote:

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

"Mike H" wrote:

Try

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

Mike

"Songoku" wrote:

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



All times are GMT +1. The time now is 03:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com