Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macros and cells


If I copy a cell that contains a macro, will the macro also be copied
across and the cell reference altered ie the same as a worksheet
function would be?

If not is there a way to do this?


--
frustrated
------------------------------------------------------------------------
frustrated's Profile: http://www.excelforum.com/member.php...o&userid=27778
View this thread: http://www.excelforum.com/showthread...hreadid=494331

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default macros and cells

How did you you put the macro in the cell?
--
Gary's Student


"frustrated" wrote:


If I copy a cell that contains a macro, will the macro also be copied
across and the cell reference altered ie the same as a worksheet
function would be?

If not is there a way to do this?


--
frustrated
------------------------------------------------------------------------
frustrated's Profile: http://www.excelforum.com/member.php...o&userid=27778
View this thread: http://www.excelforum.com/showthread...hreadid=494331


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default macros and cells

What does this macro do? What are you trying to accomplish? You will have to
provide us with some more detail. Generally formulas are copied to cells, not
macros.
--
David


"frustrated" wrote:


If I copy a cell that contains a macro, will the macro also be copied
across and the cell reference altered ie the same as a worksheet
function would be?

If not is there a way to do this?


--
frustrated
------------------------------------------------------------------------
frustrated's Profile: http://www.excelforum.com/member.php...o&userid=27778
View this thread: http://www.excelforum.com/showthread...hreadid=494331


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default macros and cells

a cell doesn't contain a macro, it can contain a function, however.
A functions first character must be the "=" (without the quote marks (though
excel does allow the Lotus users the
convenience of using the + and the - )
By default all cells (for copying and pasting purposes) are set to Relative.
There is another setting call Absolute, whch uses the "$" to Anchor a cell
reference (disallowing a change to it on Copy/paste)
In a function where cell references are used, example
A1...
can be
$A1 << Column A will remain fixed upon being copied/pasterd
A$1 << Row 1 will remain fixed upon being copied/pasted
$A$1 << A1 will retain its position (A1) upon being pasted.

In edit mode - click inside a single cell reference and press the F4 key, do it
again, and again.
Each time you will see excel circulate making the relative/absolute change..

Hope this helps..


"frustrated" wrote in
message ...

If I copy a cell that contains a macro, will the macro also be copied
across and the cell reference altered ie the same as a worksheet
function would be?

If not is there a way to do this?


--
frustrated
------------------------------------------------------------------------
frustrated's Profile:
http://www.excelforum.com/member.php...o&userid=27778
View this thread: http://www.excelforum.com/showthread...hreadid=494331



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macros and cells


My macro is not contained in a cell. Sorry my mistake.

What I meant was I have a macro that enters something into a specifi
cell. Now if I copy or cut that cell to another location will the cod
also change or will I have to edit it?

The reason I'm asking is that I have about 30 cells and I dont reall
want to have to alter code for each one.


Thanks for your hel

--
frustrate
-----------------------------------------------------------------------
frustrated's Profile: http://www.excelforum.com/member.php...fo&userid=2777
View this thread: http://www.excelforum.com/showthread.php?threadid=49433



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default macros and cells

It depends on how you are referring to the "cells" in your code. If your using
Range("A1"), or the like then the answer to your question is NO Moving A1
will not change the code.. it will still show Range("A1").

If you have used RangeNames, that's a different story
In your Code Range("MyRange1") then Your code
and your spreadsheet will stay IN SYNC.

HTH


f in your code you
"frustrated" wrote in
message ...

My macro is not contained in a cell. Sorry my mistake.

What I meant was I have a macro that enters something into a specific
cell. Now if I copy or cut that cell to another location will the code
also change or will I have to edit it?

The reason I'm asking is that I have about 30 cells and I dont really
want to have to alter code for each one.


Thanks for your help


--
frustrated
------------------------------------------------------------------------
frustrated's Profile:
http://www.excelforum.com/member.php...o&userid=27778
View this thread: http://www.excelforum.com/showthread...hreadid=494331



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
Naming Cells with Macros aynsley Excel Discussion (Misc queries) 1 June 8th 06 08:47 PM
How to use macros to copy a range of cells which can exclude some cells which I didn't want to be copied? excelnovice Excel Worksheet Functions 2 September 25th 05 12:38 AM
Protecting Cells with macros Peter McCaul Excel Programming 2 August 18th 04 05:07 PM
Excel 97 macros in cells? Stefan Schier Excel Programming 2 July 28th 04 07:49 PM
Referencing Cells in Macros Gerry[_7_] Excel Programming 2 October 24th 03 01:25 PM


All times are GMT +1. The time now is 02:18 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"