Copy Paste to a range

niha

New Member
Joined
May 6, 2021
Messages
19
Office Version
  1. 2019
Platform
  1. Windows
Hi guys!
I want to find the last filled cell in column H, then find the last filled cell in column E i.e the date and paste it till column H's last filled row in column E. I am not able to fill all the cells in the range. I attached the copy of how I want it in the sheet.

Using this
VBA Code:
Sub copynow()
   Cells(Rows.Count, "H").End(xlUp).Select
   a = ActiveCell.Row
   ActiveCell.Offset(0, -3).Select
   Cells(Rows.Count, "E").End(xlUp).Select
   ActiveCell.Copy
Cells(Rows.Count, "H").End(xlUp).Select
ActiveCell.Offset(0, -3).Select
ActiveSheet.Paste
End Sub
 

Attachments

  • Capture.JPG
    Capture.JPG
    31.1 KB · Views: 7
  • Capture 2.JPG
    Capture 2.JPG
    34.1 KB · Views: 7

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
VBA Code:
Sub copynow()
    Range(Cells(Rows.Count, "E").End(xlUp), Cells(Rows.Count, "H").End(xlUp).Offset(0, -3)).Value = _
        Cells(Rows.Count, "E").End(xlUp).Value
End Sub
 
Upvote 0
Thanks A lott!!
This is Perfect!
Need some more help on this though. So basically I wanted to sort everything from D:H based on these dates which is why I needed them to be copied in the first place.
Like everything in rows of date 5/12/21 must be above 5/13/21 dates. Something like this.
 

Attachments

  • 11.jpg
    11.jpg
    67.4 KB · Views: 6
  • 2.JPG
    2.JPG
    52.7 KB · Views: 6
Upvote 0
VBA Code:
Sub copynow()
    Range(Cells(Rows.Count, "E").End(xlUp), Cells(Rows.Count, "H").End(xlUp).Offset(0, -3)).Value = _
        Cells(Rows.Count, "E").End(xlUp).Value
        
    Range("D:H").Sort Key1:=Range("E1"), Order1:=xlAscending, Header:=xlGuess
    
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,214,899
Messages
6,122,155
Members
449,068
Latest member
shiz11713

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