Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXCEL... Using VBA to Display Spreadsheet(a1:c1) DATA

Status
Not open for further replies.

postonz

Programmer
Jan 12, 2000
8
US
What code do I use to Gather the cells data(a1:c1) to a Form with TextBox9 as the display box for user....
Thanks
[sig]<p>Joe Poston<br><a href=mailto:joeposton@ij.net>joeposton@ij.net</a><br><a href= Software</a><br>I am retired and have some time for Visual Basic / Access / AutoCad Design and Visual Basic automation / Web_Site Design... call anytime...[/sig]
 
I'm not sure exactly what you want to do with the data or how to format it, but this should show you how to get the value of a cell.

I Put a text box and command button on sheet 2 of a workbook. The Click event for command button 1 is shown below. this takes the values from cells A1 - C1, puts them all in a string variable and assigns that variable to the text box

Private Sub CommandButton1_Click()
Dim A1C1Val As String

A1C1Val = Str(Application.Sheets(&quot;Sheet1&quot;).Range(&quot;A1&quot;).Value)
A1C1Val = A1C1Val & Str(Application.Sheets(&quot;Sheet1&quot;).Range(&quot;B1&quot;).Value)
A1C1Val = A1C1Val & Str(Application.Sheets(&quot;Sheet1&quot;).Range(&quot;C1&quot;).Value)

TextBox1.Text = A1C1Val
End Sub
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top