Help to adjust this code slightly!

Solved/Closed
Nicklt - Aug 18, 2010 at 04:24 AM
 Nicklt - Aug 18, 2010 at 10:27 AM
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 replies

rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Aug 18, 2010 at 07:32 AM
See if this works


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

Anymore suggestions greatly welcome.
0
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Aug 18, 2010 at 08:18 AM
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)
0
Hi, it's ok i have worked it out, it was simply Selection.Copy
0