Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Unable to write to a cell

I am having surprising difficulting wriiting to a cell within a worksheet. I
have tried various approaches and have receive the same erro on all attempts;
Code below

Set rawRange = Range("B5")
rawRange.Value = "data"

Or

ActiveWorkbook.Worksheets("test1").Cells(2, 2).Value = "Please work"

in the first example I can read the data out via the immediate window, but
can't write out..
I get this error "Application-defined or object-defined error" Please help!!!



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Unable to write to a cell

David,

try this:

Range("B5").Value = "Try this"

If you want to operate with variables (rowRange etc.) you have to define
them first (Dim rowRange as LOng)


"David A." wrote:

I am having surprising difficulting wriiting to a cell within a worksheet. I
have tried various approaches and have receive the same erro on all attempts;
Code below

Set rawRange = Range("B5")
rawRange.Value = "data"

Or

ActiveWorkbook.Worksheets("test1").Cells(2, 2).Value = "Please work"

in the first example I can read the data out via the immediate window, but
can't write out..
I get this error "Application-defined or object-defined error" Please help!!!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default Unable to write to a cell

David,

Try this sub:
Sub addata()
Dim rawRange as Range ' It's important to define as Range _
instead of other define

Set rawRange = Range("B5")
rawRange.Value = "data"

End Sub


--
Regards,

Halim



"Thomas" wrote:

David,

try this:

Range("B5").Value = "Try this"

If you want to operate with variables (rowRange etc.) you have to define
them first (Dim rowRange as LOng)


"David A." wrote:

I am having surprising difficulting wriiting to a cell within a worksheet. I
have tried various approaches and have receive the same erro on all attempts;
Code below

Set rawRange = Range("B5")
rawRange.Value = "data"

Or

ActiveWorkbook.Worksheets("test1").Cells(2, 2).Value = "Please work"

in the first example I can read the data out via the immediate window, but
can't write out..
I get this error "Application-defined or object-defined error" Please help!!!



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
I WANT TO WRITE 18 DIGITS FIGURE IN A SINGLE CELL. bu i m unable. deva Excel Discussion (Misc queries) 5 May 14th 09 01:24 PM
Can I write an infinite amount in a cell with expanding the cell? adrnlnjnky Excel Discussion (Misc queries) 1 July 20th 07 10:32 AM
Why am I unable to link a cell in one worksheet to a cell in anot. Dave Excel Discussion (Misc queries) 1 January 8th 05 01:51 AM
Unable to set the active cell from VBA HMS New Users to Excel 1 December 7th 04 09:56 PM
Question: Cell formula or macro to write result of one cell to another cell Frederik Romanov Excel Programming 1 July 8th 03 03:03 PM


All times are GMT +1. The time now is 12:50 AM.

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"