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!
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

AlanY

Well-known Member
Joined
Oct 30, 2014
Messages
4,191
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,191
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
you're welcome
 

Watch MrExcel Video

Forum statistics

Threads
1,109,436
Messages
5,528,749
Members
409,834
Latest member
vexceled

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top