Help to adjust this code slightly!

Solved/Closed
Nicklt - 18 Aug 2010 à 04:24
 Nicklt - 18 Aug 2010 à 10:27
Hello,

I have this code,

Sub IMPORT()
Dim NextRow As Long

Sheets("New & Renewals").Range("A4:D4").Copy

NextRow = Sheets("Approved & Completed").Range("A" & Rows.Count).End(xlUp).Row + 1

Sheets("Approved & Completed").Range("A" & NextRow).PasteSpecial Paste:=xlPasteValues

End Sub


The part in bold "A4:D4" i want this to actually be what the User has currently highlighted, so in other words what the user has currently selected on the worksheet.

Thanks.

.


3 responses

rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
18 Aug 2010 à 07:32
See if this works


Sheets("New & Renewals").selection.Copy
Hi Rizvisa, i replaced Sheets("New & Renewals").Range("A4:D4").Copy with you suggestion and got a Runtime Error: 438

Anymore suggestions greatly welcome.
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
18 Aug 2010 à 08:18
Could you please upload a sample EXCEL file WITH sample data, macro, formula , conditional formatting etc on some shared site like https://authentification.site , http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc
A N D post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too

Also please write a couple of lines on how to use your macro and how to re-create your issue (please list steps for I am a dummy)
Hi, it's ok i have worked it out, it was simply Selection.Copy