Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Function not performing copy

For a variety of solid reasons that are too lengthy and irrelevant t
get into here, I have the following setup: a cell that contains th
following formula:

=GetTheText("D95", "D49")

(D95 and D49 are just examples. What is important is that the cell tha
contains this formula is neither cell D95 or D49.)

Here is the GetTheText function:

Function GetTheText(SourceCell As String, TargetCell As String)

Range(SourceCell).Select
Selection.Copy
Range(TargetCell).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False

End Function

Nothing seems to happen. When I check the clipboard it shows nothing i
there. Is there any reason why a function might refuse to put a valu
into another cell? Seems unlikely. Can anyone help, please?

thank you!

the code

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Function not performing copy

'Cause functions are not allowed to change their environment, they can only
return a variable.

--
Regards,

Juan Pablo González

"ppsza " wrote in message
...
For a variety of solid reasons that are too lengthy and irrelevant to
get into here, I have the following setup: a cell that contains the
following formula:

=GetTheText("D95", "D49")

(D95 and D49 are just examples. What is important is that the cell that
contains this formula is neither cell D95 or D49.)

Here is the GetTheText function:

Function GetTheText(SourceCell As String, TargetCell As String)

Range(SourceCell).Select
Selection.Copy
Range(TargetCell).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

End Function

Nothing seems to happen. When I check the clipboard it shows nothing in
there. Is there any reason why a function might refuse to put a value
into another cell? Seems unlikely. Can anyone help, please?

thank you!

the code:


---
Message posted from http://www.ExcelForum.com/



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
Steps to performing R2 function with excel ICP Jon Excel Worksheet Functions 3 May 21st 08 12:04 AM
Copy function with Excel 2003 not performing correctly wtztips Excel Worksheet Functions 2 June 11th 07 05:06 PM
Performing a function on visible cells only in a range creative Excel Discussion (Misc queries) 2 April 9th 07 05:14 PM
Cell Size Between Worksheets when performing a copy and paste Kara Excel Discussion (Misc queries) 1 October 27th 06 04:08 AM
Performing a function on a column of variable length BeenThereGotLost Excel Worksheet Functions 3 July 1st 05 02:50 PM


All times are GMT +1. The time now is 11:19 AM.

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

About Us

"It's about Microsoft Excel"