Inserting textbox contents into a spreadsheet


Posted by J Tompson on August 15, 2001 2:29 AM

Hi,

I'm having some trouble with my userform. I'd like to insert the in formation placed in a textbox into a speficied cell on my sheet. The code i'm using is Textbox1.value = range("a1").value which should work. The problem is i can't write any text in the textbox to insert!!

I've tried to chenge it slightly by adding the code into the list of commands under a command button...

Private Sub CommandButton1_Click()
Client.value = Range("ClientRef").value
End Sub


This allows me to write in the text box but still doesn't insert the connects into a spreadsheet.

I'm using excel 97 and getting fed up. Any help would be greatly appreciated.

John

Posted by Dax on August 15, 2001 2:53 AM


John,

To assign the value of a textbox to say cell A1 use:-

Range("A1").Value=Textbox1.Text

You can omit the Value and Text properties as they are the default of the Range and Textbox objects respectively so you could use this:-

Range("A1")=Textbox1

I hope this helps.

Dax.



Posted by J Tompson on August 15, 2001 3:52 AM

Great help, thanks alot!!