|
|
|
Author |
Message |
SpookyET
|
Posted: Tue Dec 30 08:03:17 CST 2003 |
Top |
Excel Programming >> Putting text in a cell
OK, I must be missing something obvious here?
Worksheets("Sheet1").Select 'Select sheet1 sheet
Range("A5").Select ' Selects top row below title
Selection.EntireRow.Insert 'Inserts a new row at that point
MsgBox (TextBox1.Value)
Range("A5").Select
TextBox1.Text = ActiveCell.FormulaR1C1 'inserts name
TextBox2.Value = Range("E5").FormulaR1C1 'inserts county
It works fine up to MsgBox..where it displays the *correct* value.
Yet it won't insert it into a cell, using either Range..select then
ActiveCell.. or Range..Formula..
Just blank cells?
What am I missing here?
Thanks,
Ben
--
BWGames
to email change de.news to de-news
Excel195
|
|
|
|
|
Tom
|
Posted: Tue Dec 30 08:03:17 CST 2003 |
Top |
Excel Programming >> Putting text in a cell
you have your assignments backwards:
Range("A5").Select
ActiveCell.Value = Textbox1.Text
Range("E5").Value = Textbox2.Text
--
Regards,
Tom Ogilvy
> OK, I must be missing something obvious here?
>
> Worksheets("Sheet1").Select 'Select sheet1 sheet
> Range("A5").Select ' Selects top row below title
> Selection.EntireRow.Insert 'Inserts a new row at that point
> MsgBox (TextBox1.Value)
> Range("A5").Select
> TextBox1.Text = ActiveCell.FormulaR1C1 'inserts name
> TextBox2.Value = Range("E5").FormulaR1C1 'inserts county
>
> It works fine up to MsgBox..where it displays the *correct* value.
> Yet it won't insert it into a cell, using either Range..select then
> ActiveCell.. or Range..Formula..
>
> Just blank cells?
>
> What am I missing here?
>
> Thanks,
>
> Ben
>
>
> --
> BWGames
> to email change de.news to de-news
|
|
|
|
|
BWGames
|
Posted: Tue Dec 30 08:11:37 CST 2003 |
Top |
Excel Programming >> Putting text in a cell
On Tue, 30 Dec 2003 09:03:17 -0500, in microsoft.public.excel.programming,
> you have your assignments backwards:
>
> Range("A5").Select
> ActiveCell.Value = Textbox1.Text
> Range("E5").Value = Textbox2.Text
Changed it to
MsgBox (TextBox1.Text)
TextBox1.Text = Range("A5").Value 'inserts name
etc etc
MsgBox still works, but still blank in the cells...
Thanks,
Ben
--
BWGames
to email change de.news to de-news
|
|
|
|
|
Tom
|
Posted: Tue Dec 30 09:20:15 CST 2003 |
Top |
Excel Programming >> Putting text in a cell
If you want the value in the cell, then you should reverse the order of your
assignment
Range("A5").Value = Textbox1.Text
instead of your persistent entry of
> TextBox1.Text = Range("A5").Value 'inserts name
which you've already proven doesn't work and I already explained why it
doesn't work.
did you bother to read my previous response?
--
Regards,
Tom Ogilvy
> On Tue, 30 Dec 2003 09:03:17 -0500, in microsoft.public.excel.programming,
>
> > you have your assignments backwards:
> >
> > Range("A5").Select
> > ActiveCell.Value = Textbox1.Text
> > Range("E5").Value = Textbox2.Text
>
> Changed it to
>
> MsgBox (TextBox1.Text)
> TextBox1.Text = Range("A5").Value 'inserts name
>
> etc etc
>
> MsgBox still works, but still blank in the cells...
>
> Thanks,
>
> Ben
> --
> BWGames
> to email change de.news to de-news
|
|
|
|
|
BWGames
|
Posted: Tue Dec 30 11:08:27 CST 2003 |
Top |
Excel Programming >> Putting text in a cell
On Tue, 30 Dec 2003 10:20:15 -0500, in microsoft.public.excel.programming,
> If you want the value in the cell, then you should reverse the order of your
> assignment
>
> Range("A5").Value = Textbox1.Text
>
> instead of your persistent entry of
>> TextBox1.Text = Range("A5").Value 'inserts name
>
> which you've already proven doesn't work and I already explained why it
> doesn't work.
>
> did you bother to read my previous response?
Ahh, got you now. Sorry, I didn't realise that the order made a difference.
Works now, thanks :)
--
BWGames
to email change de.news to de-news
|
|
|
|
|
|
|