msal727

New Member
Joined
Jun 13, 2019
Messages
7
Hello all, first time posting here!

How can I modify this code to always look for the next available line? when I run this it just overrides whatever is already there.


Any help would be GREATLY appreciated! TIA

Code:
Sub add_diagnosticdeliverable()
'
' add_diagnosticdeliverable Macro
'


    'Copy the data
    Sheets("Deliverable Master List").Range("A3:I13").Copy
    'Activate the destination worksheet
    Sheets("Template").Activate
    'Select the target range
    Range("A2").Select
    'Paste in the target destination
    ActiveCell.Offset(1, 0).Range("A1").Select
    ActiveSheet.Paste


    Application.CutCopyMode = False
    
   
End Sub
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Hi & welcome to MrExcel.
How about
Code:
Sub add_diagnosticdeliverable()
    Sheets("Deliverable Master List").Range("A3:I13").Copy Sheets("Template").Range("A" & Rows.Count).End(xlUp).Offset(1)
End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
Hi & welcome to MrExcel.
How about
Code:
Sub add_diagnosticdeliverable()
    Sheets("Deliverable Master List").Range("A3:I13").Copy Sheets("Template").Range("A" & Rows.Count).End(xlUp).Offset(1)
End Sub


Do you know if I can make this code specific to the sheet is being added to? so active sheet vs. sheets("Template")? TIA
 
Upvote 0
If you always want to copy to the active sheet rather than the Template use
Code:
Sub add_diagnosticdeliverable()
    Sheets("Deliverable Master List").Range("A3:I13").Copy Range("A" & Rows.Count).End(xlUp).Offset(1)
End Sub
 
Upvote 0
If you always want to copy to the active sheet rather than the Template use
Code:
Sub add_diagnosticdeliverable()
    Sheets("Deliverable Master List").Range("A3:I13").Copy Range("A" & Rows.Count).End(xlUp).Offset(1)
End Sub

AWESOME!! Thank you soo much!!
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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