Hi,
I'm trying to get this to paste what I've copied starting in cell A30, rather than A1. I think it's the .End(xlUp).Row part, but I'm not sure what to change it to...
![]()
Please Login or Register to view this content.
Hi,
I'm trying to get this to paste what I've copied starting in cell A30, rather than A1. I think it's the .End(xlUp).Row part, but I'm not sure what to change it to...
![]()
Please Login or Register to view this content.
TRy this
![]()
Please Login or Register to view this content.
Have you tried End(xlDown) instead of End(xlUp)
End(xlUp) takes you to the relative topmost row in the area or region,
which can be the bottomest row of the nearest populated area in the upward direction, if the cell area you are starting with is blank
or the topmost row of the populated area in the upward direction, if the cell area you are starting with is within in the populated area.
while End(xlDown) works in the same manner in the downward direction.
...in order to get the next available / empty cell or row at the bottom of the list, you should combine End(xlDown).Offset(1,0)
Last edited by ChuckYeager; 07-18-2012 at 10:55 AM. Reason: spellings and omissions
Fredlo- your solution would have worked, but it interfered with other parts of my code. For some reason, it would only paste one of the several copied worksheets.
Chuck- Using the End(xlDown).Offset(1,0) code makes the next line of code (wsTarget.Range("A" & nTargetLastRow + 0).PasteSpecial) get caught up in debugging.
At the point at which anything is pasted onto the spreadsheet, the spreadsheet is entirely empty, I need it to start pasting on A30
can you provide all the code?
Try this changing the line
.![]()
Please Login or Register to view this content.
with
![]()
Please Login or Register to view this content.
That seemed to lead to the same result. Here is the full code of the sub leading up to the pasting section. With this code, it does copy/paste for all worksheets correctly, but it starts pasting on cell A1.
![]()
Please Login or Register to view this content.
---------- Post added at 11:10 AM ---------- Previous post was at 10:51 AM ----------
If I change
to![]()
Please Login or Register to view this content.
It starts pasting on A2, but it gets off track if I change it to + 30![]()
Please Login or Register to view this content.
---------- Post added at 11:17 AM ---------- Previous post was at 11:10 AM ----------
Doh, got it. I had some formulas way down in the code that were still trying to act on the assumption that it was pasted in cell A1...Thanks for all your help, I learned a few tricks from it all
Try this, If it doesn't work. can you you atatche a copy of you workbook as well. So i can properly test it. I tried it with some dummy data and it works.
![]()
Please Login or Register to view this content.
Success! Thanks again!!!
I see you got the solution...and I get to learn about .Resize
Last edited by ChuckYeager; 07-18-2012 at 12:47 PM. Reason: Editing response
I am glad it worked.
Just realized an easy fix that would have solved it all- after it pasted into A1, I could have had it just insert 30 rows to push the data down![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks