Excel Macro Help Please

nfrazer

New Member
Joined
Jul 20, 2011
Messages
6
I'm having a brain drain - I'm trying to record a macro where I'd like to copy from one row (at the top of the spreadsheet) and paste the value on the next available row in the spreadsheet. I tried Ctrl End, Home, and then arrow down, but it then always goes to the same row and overwrites what was there. Thank you!!!!
 
The range is A5:AA5. I've used the macro you suggested and it works except that it doesn't paste it as values. It gives me the same formulas as what was on row 5. How do I paste it as values? :)
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
As Nalani points out, this will check Column A to see where the last row with data is. If there may be blank cells, you may want to use the .Find Method.

If there are not blank cells in the data, try:

Rich (BB code):
Option Explicit
    
Sub exa()
    With ThisWorkbook.Worksheets("Sheet1") '<---or just use the sheet's codename
        .Cells(.Rows.Count, "A").End(xlUp).Offset(1).Resize(, 27).Value = .Range("A5:AA5").Value
    End With
End Sub

Hope that helps,

Mark
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,473
Members
452,915
Latest member
hannnahheileen

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