VBA Cut rows and paste values

viceman57

New Member
Joined
Feb 20, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I am running the following code to move rows based off of a drop down selection. It is all working fine but it is bringing formulas over to the new sheet with the data.

I want to just bring the values as they are so they stop updating on the new sheet. Is there a paste values I can insert in here?

1708453643946.png
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Maybe if you change the copy lines like this:

VBA Code:
Range("a" & Target.Row).Resize(, 18).Copy
.Cells(.Rows.Count, "a").End(xlUp).Offset(1).PasteSpecial xlPasteValues
 
Upvote 0
Solution
Maybe if you change the copy lines like this:

VBA Code:
Range("a" & Target.Row).Resize(, 18).Copy
.Cells(.Rows.Count, "a").End(xlUp).Offset(1).PasteSpecial xlPasteValues

This worked! Thanks. just because I like to understand things and I did try this yesterday.

Why does the .cells row need to be moved down a row for this to work?
 
Upvote 0
This worked! Thanks. just because I like to understand things and I did try this yesterday.

Why does the .cells row need to be moved down a row for this to work?
You're welcome, and happy to help.

If I am not wrong, I believe .PasteSpecial does not work with in-line copy/paste, requiring a new line for the paste.
 
Upvote 0

Forum statistics

Threads
1,215,110
Messages
6,123,138
Members
449,098
Latest member
Doanvanhieu

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