Copy Values to Next Empty Row

unixanalyst

New Member
Joined
Nov 3, 2011
Messages
13
Hello,

Noob warning. I've managed plenty with formulas but when it comes to macros things are seriously hit and miss, and I think this requires a macro.
I think I could probably manage to record a macro of copying the cells to another sheet, but getting it into the next empty row...?

I copy and paste trading data into a s/s every few days. The s/s extracts the meaningful data and does some calculations to get averages, hi, lo etc.

I would like to be able to copy these calculated values out to another sheet, to the next empty row, to build up a history, before pasting in the next set of trading data.
I guess a button with a macro behind it would be the way forward but I will shout out the noob's battle cry... I'd rather do it with a formula if possible!

TIA
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
This will require VBA. Can you be more specific about the source sheet and range and the destination sheet.
 
Upvote 0
Not really possible with formula.

A macro like this would do the trick though:

Code:
Sub CopyStuff()

Range("A1:J1").Copy Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)

End Sub

It copies A1:J1 from the active sheet to the next available row in column A of Sheet2.

Dom
 
Upvote 0
Cool. This is working quite well.

However, all of the values change every time. The old ones aren't staying at the old values.
I've tried adding a second range, which is just =a1, =b1, =c1 etc and the macro runs against that, to try to avoid the formulas being copied, which they are anyway. So the Sheet2 cells contain the formulas from Sheet1, not the values. How do I copy just the values?
 
Upvote 0
Like this:

Code:
Sub CopyStuff()

Range("A1:J1").Copy

Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues

End Sub

Dom
 
Upvote 0
This is actually exactly what I need to do.

What would need to change in the code to put those values into a table rather than just bare cells? This is my code thus far:

Sub Logger()
'
' Logger Macro


Range("c22:h22").Copy


Sheets("Data").Range("J" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues


End Sub
 
Upvote 0

Forum statistics

Threads
1,216,128
Messages
6,129,033
Members
449,482
Latest member
al mugheen

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