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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA, easy question, tough answer

Status
Not open for further replies.

Donkeygirl

Technical User
Nov 30, 2000
52
US
I need to set the control source property for a text box on a form being used in excel 97. I need the value to reference a sheet's cell within the workbook. What is a valid property value for sheet1 cell E6?
This should be so easy, but everytime I try to set the control source it says invalid property value.
hope someone can help
 
Try writing this line in the INITIALIZE event of the form.

UserForm1.TextBox1.Text = ActiveSheet.Cells(6, 5)

This will put the contents of the active sheet, cell(E6) in TextBox1 of UserForm1. You can also replace ActiveSheet with Workbooks("Book1").Sheets("Sheet1").Cells(6, 5)

Best of luck
Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top