ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   creating a UDF for copy (https://www.excelbanter.com/excel-programming/426736-creating-udf-copy.html)

tg

creating a UDF for copy
 
I would like to copy cell A1 to B1 without higlighting the cell and clicking
copy. I would like to use a UDF to copy a cell.


can anyone helomp me?

Thanks in advance,

TG

Sheeloo[_5_]

creating a UDF for copy
 
Try
Function copyCell(rng As Range) As String
copyCell = rng
End Function

but Excel already provides for that
simply say
=A1
in B1
-------------------------------------
Pl. click ''''Yes'''' if this was helpful...



"TG" wrote:

I would like to copy cell A1 to B1 without higlighting the cell and clicking
copy. I would like to use a UDF to copy a cell.


can anyone helomp me?

Thanks in advance,

TG


JMay

creating a UDF for copy
 
Wouldn't it be best to assign
Function copyCell(rng As Range) As Variant ?

"Sheeloo" wrote:

Try
Function copyCell(rng As Range) As String
copyCell = rng
End Function

but Excel already provides for that
simply say
=A1
in B1
-------------------------------------
Pl. click ''''Yes'''' if this was helpful...



"TG" wrote:

I would like to copy cell A1 to B1 without higlighting the cell and clicking
copy. I would like to use a UDF to copy a cell.


can anyone helomp me?

Thanks in advance,

TG


Simon Lloyd[_1077_]

creating a UDF for copy
 

A function can only return a value not physically perform a copy, is
that what you really want?

TG;304001 Wrote:
I would like to copy cell A1 to B1 without higlighting the cell and
clicking
copy. I would like to use a UDF to copy a cell.


can anyone helomp me?

Thanks in advance,

TG



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=85025


Sheeloo[_5_]

creating a UDF for copy
 
Yes.

Thanks for pointing that out.

"JMay" wrote:

Wouldn't it be best to assign
Function copyCell(rng As Range) As Variant ?

"Sheeloo" wrote:

Try
Function copyCell(rng As Range) As String
copyCell = rng
End Function

but Excel already provides for that
simply say
=A1
in B1
-------------------------------------
Pl. click ''''Yes'''' if this was helpful...



"TG" wrote:

I would like to copy cell A1 to B1 without higlighting the cell and clicking
copy. I would like to use a UDF to copy a cell.


can anyone helomp me?

Thanks in advance,

TG



All times are GMT +1. The time now is 02:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com