Copy/Paste on the last active row of particular sheet

CALEB23

New Member
Joined
Oct 1, 2024
Messages
4
Office Version
  1. Prefer Not To Say
Platform
  1. Windows
  2. Web
Hello All.

I'm creating a macro wherein data captured from SAP scripting will automatically pasted on another sheet of its last row i.e Range "A", what will be the starting script for this?

Here is my sample script.
1727769198491.png


I really appreciate any help you can provide.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
do you really want to paste in last row or in first empty row? See comment to first line below

instead of last 2 lines of your code use:

Excel Formula:
dim lastrow as long
lastrow = Range("A"&rows.count).end(xlup).row+1 'if really overwriting last row then delete +1
Range("A"&lastrow).PasteSpecial ....

first few could be also shortened, but I don't want to retype code from your screenshot :) and these lines will work in the form they are now. Could be just more elegant.
 
Upvote 0
do you really want to paste in last row or in first empty row? See comment to first line below

instead of last 2 lines of your code use:

Excel Formula:
dim lastrow as long
lastrow = Range("A"&rows.count).end(xlup).row+1 'if really overwriting last row then delete +1
Range("A"&lastrow).PasteSpecial ....

first few could be also shortened, but I don't want to retype code from your screenshot :) and these lines will work in the form they are now. Could be just more elegant.
Great, it works! Thanks, Kaper for your help, I appreciate it. :)
 
Upvote 0

Forum statistics

Threads
1,222,626
Messages
6,167,157
Members
452,099
Latest member
Auroraaa

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