Textbox rowsource

ganesh_05

New Member
Joined
Aug 11, 2005
Messages
43
Hi friends...

I have been facing a problem with textbox rowsource method....

is the following syntax a correct one??

textbox1.rowsource = "Demand!A3:Y100"

Demand is sheet name...

do i need to change any of text box properties ??

When i m running the form... i m facing the following error ...

"Couldnot set the rowsource property. Member not found."

Any help.. ??

Thanks in advance...
Ganesh.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

tactps

Well-known Member
Joined
Jan 20, 2004
Messages
3,459
Rowsource is only used for list boxes or combo boxes, not text boxes.
 

Fat Cat

Active Member
Joined
Nov 5, 2004
Messages
336
You normally assign data to a TextBox by;

TextBox1.Text = Sheets("Demand").Range("A1").Value

or

TextBox1.Text = Sheets("Demand").Cells(1,1).Value

If you want to display data from more than 1 cell on the spreadsheet in the same textbox at the same time, you need to add the data together first, you can't assign from several cells at the same time.

eg:

Dim myText as variant

For i = 1 to 10
myText = myText & Sheets(1).Cells(i,1) & vbCr
Next i

TextBox1.Text = myText
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,282
Office Version
  1. 365
Platform
  1. Windows
RowSource is not a property of a textbox.
 

ganesh_05

New Member
Joined
Aug 11, 2005
Messages
43

ADVERTISEMENT

Thank you very much for your replies...

but when i checked the help from excel... it says abt text box as...

"A TextBox is the control most commonly used to display information entered by a user. Also, it can display a set of data, such as a table, query, worksheet, or a calculation result. If a TextBox is bound to a data source, then changing the contents of the TextBox also changes the value of the bound data source."

I want to populate a table in the textbox and the table is from a worksheet ... so i want to bound the textbox to a data source (here it is DEMAND sheet)... my user can edit the table thats y i m not using listbox here...

is it not possible??

and when i was writing the code... it is populating rowsource property/method when i write textbox... then how come rowsource doesn't apply to textbox??
 

ganesh_05

New Member
Joined
Aug 11, 2005
Messages
43
Ok now i understand that rowsource is not a textbox's property...

can u please suggest me a way to bound the textbox to a data source... i want the textbox to display a table...
 

tactps

Well-known Member
Joined
Jan 20, 2004
Messages
3,459

ADVERTISEMENT

VBA help for "rowsrouce property":

Specifies the source providing a list for a ComboBox or ListBox.

No mention of textboxes there.

Fat Cat has a solution for you.
 

Fat Cat

Active Member
Joined
Nov 5, 2004
Messages
336
You could display a table if you use a multicolumn ListBox.

If your data is in consecutive columns, just use the RowSource property to fill it with the data.

Otherwise you need to create an array and fill that with the data you want, then assign the array to the ListBox.
 

ganesh_05

New Member
Joined
Aug 11, 2005
Messages
43
I want to allow the user to edit the data...

But the user can't edit the data if i provide the data with a listbox...

thats y i m using a textbox...
 

Watch MrExcel Video

Forum statistics

Threads
1,129,685
Messages
5,637,808
Members
416,983
Latest member
LessThanAverageUser

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top