macro/formula query

  • Thread starter Thread starter ker
  • Start date Start date
K

ker

Hello

I am looking to create a macro button which when pressed will copy data
(values) in cells d18 to d20 to cells d26 to d28 in a spreadsheet.

Cells d18 to d20 represents figures as at mtd - the following day, I
would like these amounts to appear as values in cells d26 to d28
representing figures at at mtd yesterday.

When I then overwrite cells d18 to d20 with current days figures, I do
not want this to effect cells d26 to d28 until the next day when I
press the macro button.

If anyone can help, I would be very grateful.

Thank you.
 
Ker, see if something like this will work for you

Sub copy()
Sheet1.Range("D26:D28").Value = Sheet1.Range("D18:D20").Value
End Sub

--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 
ker said:
*Hello

I am looking to create a macro button which when pressed will copy
data (values) in cells d18 to d20 to cells d26 to d28 in a
spreadsheet.

Cells d18 to d20 represents figures as at mtd - the following day, I
would like these amounts to appear as values in cells d26 to d28
representing figures at at mtd yesterday.

When I then overwrite cells d18 to d20 with current days figures, I
do not want this to effect cells d26 to d28 until the next day when I
press the macro button.

If anyone can help, I would be very grateful.

Thank you. *
 
Paul B

Thanks for replying - unfortunately I cannot get it to work - do you
have any other tips ?

Thanks again.

Ker
 
Ker, To put in this macro, from your workbook right-click the workbook's
icon and pick View Code. This icon is to the left of the "File" menu this
will open the VBA editor, in the left hand window click on your workbook
name, go to insert, module, and paste the code in the window that opens on
the right hand side, press Alt and Q to close this window and go back to
your workbook and press alt and F8, this will bring up a box to pick the
Macro from, click on the Macro name to run it. If you are using excel 2000
or newer you may have to change the macro security settings to get the macro
to run.

--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 
Back
Top