Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default passing cell address to sub - write that cell

What am I doing wrong?

function xx (x as range) as whatever
x.value2 = "test"

or
x.text = "test"


compiles - I can see the object - but bombs. ????


Entered function in cell as xx(B5)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default passing cell address to sub - write that cell

Hi,

Am Tue, 4 Feb 2014 20:18:30 -0800 (PST) schrieb :

function xx (x as range) as whatever
x.value2 = "test"


try:
Function xx(x As Range) As String
xx = x.Value
End Function


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 829
Default passing cell address to sub - write that cell

wrote:
What am I doing wrong?
function xx (x as range) as whatever
x.value2 = "test"
or
x.text = "test"

[....]
Entered function in cell as xx(B5)


When VBA code is invoked directly or indirectly from a formula in an Excel,
the VBA code cannot modify cells directly.

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
Passing single-cell vs multi-cell ranges to a variant array? ker_01 Excel Programming 0 July 30th 09 11:03 PM
how do I write a formula: if (cell address) is less than X add Y CTrophyMan Excel Discussion (Misc queries) 4 December 1st 05 06:17 PM
Passing Cell Address (String or Range) ExcelMonkey[_190_] Excel Programming 6 March 16th 05 05:11 PM
Passing Cell Address to Offset Bob Excel Worksheet Functions 2 December 1st 04 04: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 10:09 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"