copying to a new worksheet

ctomblin

New Member
Joined
Apr 25, 2002
Messages
49
I create a new worksheet at the beginning of every week and would like to be able to copy the final-total cell from last weeks worksheet into the new worksheet
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Sounds like a cake walk. You can copy or paste or use vba. Depends on the cell location of the total and the cell location of the deposit.
 
Upvote 0
Sample code (in the event you'd like vba):

Code:
Sub Copy()
Sheet1.[a1].Copy Sheet2.[a5]
End Sub

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue">O</font></font></font>
This message was edited by NateO on 2002-04-26 08:49
 
Upvote 0
Try this:

Sub DataList()
'To use build a data list on Sheet1.
'Put a lable in A1 on Sheet2.
'Then select data on Sheet1 & run this code.

'Copy the current selection on Sheet1 &
'amend paste selection to bottom of data
'list on Sheet2.

'Copy the current selection on Sheet1.
Sheets("Sheet1").Select
Selection.Copy

'Go to sheet2, find the next empty cell & paste.
Sheets("Sheet2").Select
ActiveSheet.Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste

'Go back to the original sheet.
Sheets("Sheet1").Select
Range("A1").Select
End Sub

Hope this helps. JSW
 
Upvote 0
One could streamline JWS's a little, runs faster without selecting and extends the life of your keyboard:

Code:
Sub DataList2()
Selection.Copy Sheet2.[a65536].End(xlUp).Offset(1, 0)
End Sub

Or, if you can create methodology to consistently identify your target, you substitute [a1] with that methodology:

Code:
Sub DataList3()
Sheet1.[a1].Copy Sheet2.[a65536].End(xlUp).Offset(1, 0)
End Sub

No harm intended here...
_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue">O</font></font></font>
This message was edited by NateO on 2002-04-26 09:16
 
Upvote 0
NateO,

No harm taken.

I know the selects are not needed, I just like to keep the code self-explaining for both new users and complex code.

Plus, you and I both know just about any code can be made specific or universal. Does the user want to select the cell to perform the action on or does the user want the same cell or range used each time?

Thanks, we all should like all the help we can get. JSW
This message was edited by Joe Was on 2002-04-26 09:56
 
Upvote 0
Completely agree with your post JWS. With the [a1] deal, I meant you substitute it with:<pre>[a65536].End(xlUp).Offset(1, 0)</pre> or other ways of copying a range, even if it's 'moving' target.

It's tricky responding to fairly vague posts...Have a good one.


_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue">O</font></font></font>
This message was edited by NateO on 2002-04-26 10:07
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,438
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top