Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Change text in a cell from a command button on a Userform

I am getting a runtime error 1004
I do realise that I am not addressing the cell correctly but cannot find out
how do do this.
I have 1 Sheet, 1 Userform and 1 module. My code (below) explains what I
want to do.
Any code to overcome this error would be greatly appreciated.

Private Sub CommandButton2_Click()

Sheets("sheet1").Range("K1").Text = "Off"

End Sub
--
Derek
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 342
Default Change text in a cell from a command button on a Userform

Try:

Sheets("sheet1").Range("K1").Value = "Off"

"Derek" wrote:

I am getting a runtime error 1004
I do realise that I am not addressing the cell correctly but cannot find out
how do do this.
I have 1 Sheet, 1 Userform and 1 module. My code (below) explains what I
want to do.
Any code to overcome this error would be greatly appreciated.

Private Sub CommandButton2_Click()

Sheets("sheet1").Range("K1").Text = "Off"

End Sub
--
Derek

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Change text in a cell from a command button on a Userform

The Text property is Read Only for the Range Object but is Read/Write for
everything else.

"Derek" wrote:

I am getting a runtime error 1004
I do realise that I am not addressing the cell correctly but cannot find out
how do do this.
I have 1 Sheet, 1 Userform and 1 module. My code (below) explains what I
want to do.
Any code to overcome this error would be greatly appreciated.

Private Sub CommandButton2_Click()

Sheets("sheet1").Range("K1").Text = "Off"

End Sub
--
Derek

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use Command Button from each Row to fill UserForm RyanH Excel Programming 0 September 20th 07 01:24 PM
Command button calculation from Userform and Cell reference SDH Excel Programming 6 April 18th 07 08:59 AM
need to minimize userform via command button on itself Jed[_3_] Excel Programming 1 August 10th 06 09:39 PM
Change active cell properties with command button Nick Excel Programming 2 January 30th 04 05:11 PM
Change active cell properties with command button Beto[_3_] Excel Programming 0 January 30th 04 04:58 PM


All times are GMT +1. The time now is 12:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"