help on syntax logic on paste special

Josephoo

New Member
Joined
Dec 7, 2015
Messages
21
Hi everyone

I have a small issue here and would like to seek some advice from the veteran around here.

I did the following code to copy and paste some information. however, I have managed to achieve a copy and paste into the worksheet I want.

How do I change the part that's in red to copy and paste only the values instead of the formula into another sheet called "Sheet1"?

I tried using paste special values to do it but doesn't seem to be able to get the syntax right. I'm guessing it's my lack of experience with this part.

Sub pasty()
Dim i As Integer
Dim k As Integer
Dim j As Integer


k = 6


For i = 5 To 200


If Cells(i, 15).Value = 3 And Cells(i + 1, 15).Value = "" Then


''''''''''''''copy total vol''''''''''''''''''''''''
Cells(i + 1, k).Copy ThisWorkbook.Worksheets("Sheet1").Cells(1 + j, k)

''''''''''''''copy Period'''''''''''''''''''''''''''
Cells(i, k + 1).Copy Cells(200 + j, k + 1)

''''''''''''''copy price''''''''''''''''''''''''''''
Cells(i + 1, k + 2).Copy Cells(200 + j, k + 2)

''''''''''''''copy Nature of trades''''''''''''''''''
Cells(i, k + 3).Copy Cells(200 + j, k + 3)

''''''''''''''copy remarks''''''''''''''''''''''''
Cells(i, k + 7).Copy Cells(200 + j, k + 7)

j = j + 1
Else


End If




Next
Application.CutCopyMode = False


End Sub


Any help would be appreciated.

thanks!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

AlanY

Well-known Member
Joined
Oct 30, 2014
Messages
4,342
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
try

ThisWorkbook.Worksheets("Sheet1").Cells(1 + j, k) = Cells(i + 1, k).value
 

AlanY

Well-known Member
Joined
Oct 30, 2014
Messages
4,342
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
you're welcome
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,651
Messages
5,838,586
Members
430,557
Latest member
MK15

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
Top