How to write a simple copy-paste macro?

R

R. H. Rosenberg

I've used 123 for over 20 years - simple, easy to learn and use, but my XP
OS doesn't handle it well, so I'm trying to move to Excel. But in Excel I
can't even write a simple macro such as: Copy from a cell, move down one
space, Paste. It will do this once, but then not continue. If I run it
from another cell - just restarts from the original cell.
Without further comment, I learned this macro in 2 minutes on 123. I've
been working with Excel for a week now, and I'd appreciate some help. To
recap, I simply want to be able to choose a cell having data, run a Copy
macro and have it paste to the cell below- why is this so damn hard? .

Thanks for any help.

RHR
 
N

Nick Hodge

RHR

Can be frustrating learning a new tool (Just be assured that Excel doesn't
get to number one without being better and more flexible, particularly as
1-2-3 ruled the world once)

Sub CopyAndPaste
ActiveCell.Copy Destination:=ActiveCell.Offset(1,0)
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
www.nickhodge.co.uk
 
P

Paul B

R.H. here is one way,

ActiveCell.Offset(1, 0).Value = ActiveCell.Value


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
R

Roger Govier

Hi

If you are creating the macro by switching on the Macro recorder and
carrying out the steps, then you need to switch on Relative Referencing
at the start.

Tools>Macro>Record new Macro>OK> at this point the floating toolbar with
the Stop recording icon should appear.
Next to it is an icon in the form of a Grid. Clicking this is a Toggle
between Absolute Referencing (which is what you are describing) and
Relative Referencing (that you require).

Press this toggle before starting your steps.

Be sure to use the Stop icon at the end, rather than the "x" to close,
otherwise the floating toolbar does not appear next time. If that does
happen, after you start recording the next macro, right click on a blank
area of the toolbars, and from the Toolbar dropdown, click the Stop
Recording bar and it will re-appear.
 
R

R. H. Rosenberg

I want to thank those of you who sent suggestions. After significant
further work I did create and ran a "Copy" macro, but it doesn't yet respond
to the Ctrl-Shift C command. And, I'm left with a number of test macros
which I can't seem top delete except tediously one by one.

I programmed Fortran in 1978 on punch cards - I think that was almost easier
to comprehend than Excel - of course I was a little younger. I'm now 81,
and I'm not spending the rest of my days fooling with Excel macros. I can
run Excel programs that don't require macros but otherwise I'll stick with
good old 123 and live with the quirks that occur with XP (mainly delays).

Thanks again, I do appreciate your efforts.

RHR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top