Have copied data paste below occupied cell in Column A (offset)

Pophil

New Member
Joined
Aug 3, 2016
Messages
18
I have a macro that copies data from a new worksheet then pastes it into my main workbook. Here is part of the macro I have. How do I make it so it will paste into the first free cell in column A. Also some of the data even though it is just a number has a hyperlink attached to it. When it pastes to my main workbook the hyperlink is not attached. Is there a way to have the hyperlink paste as well with the number.


ActiveWindow.WindowState = xlMinimized
Call LMFDDMACRO


Selection.Copy
ThisWorkbook.Worksheets("LastMile").Range("A3").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
ActiveWindow.Close SaveChanges:=False
ActiveWindow.WindowState = xlMaximized
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Try changing this line from
VBA Code:
ThisWorkbook.Worksheets("LastMile").Range("A3").PasteSpecial Paste:=xlPasteValues
to

VBA Code:
ThisWorkbook.Worksheets("LastMile").Range("A3").end(xlDown).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
 
Upvote 0
Solution
Try changing this line from
VBA Code:
ThisWorkbook.Worksheets("LastMile").Range("A3").PasteSpecial Paste:=xlPasteValues
to

VBA Code:
ThisWorkbook.Worksheets("LastMile").Range("A3").end(xlDown).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
Thank you that worked. Is there any way for the hyperlinks that are linked to certain numbers in my data to paste as well. Example here is a number that gets pasted. In the temp worksheet the hyperlink works but when it gets pasted to my main workbook it no longer works.

3026110946601348098801843240111
 
Upvote 0
Hi Pophil, that is a new question and one I'm unsure how to answer. I suggest you start a new thread for more visibility since other might be more familiar with Hyperlinks. But maybe this c an be resolved by using something other than xlPasteValues. Maybe using xlPasteFormulas if you are using the hyperlink formula.
 
Upvote 0
Will do thank you
Hi Pophil, that is a new question and one I'm unsure how to answer. I suggest you start a new thread for more visibility since other might be more familiar with Hyperlinks. But maybe this c an be resolved by using something other than xlPasteValues. Maybe using xlPasteFormulas if you are using the hyperlink formula.Will
 
Upvote 0
Thank you that worked.

The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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