VBA Paste Specail

JeanPyerC

New Member
Joined
Apr 5, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi Fellow Excel Team,

I need some help, I'm trying to figure out a way to paste the value only, however, the closest I've gotten is ActiveSheet.Paste.

When I try to put in ActiveSheet.PasteSpecail xl.PasteValues, I'll get an error message. Can you please help me? Thank you!


---------------------------------------------------------------------------------------------------------------------------------------------

PARTIAL CODE LISTED BELOW

Sub F_E_A_R()
'Forklift Expired Alignment Research

a = Worksheets("DATA").Cells(Rows.Count, 1).End(xlUp).Row

Application.ScreenUpdating = False

For i = 2 To a

If Worksheets("DATA").Cells(i, 5).Value = "EXPIRED" Or Worksheets("DATA").Cells(i, 5).Value = "SOON TO EXPIRE" Then

Worksheets("DATA").Cells(i, 5).Offset(0, -4).COPY
Worksheets("REPORT").Activate
B1 = Worksheets("REPORT").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("REPORT").Cells(B1 + 1, 1).Select
ActiveSheet.Paste 'this is where I need help
Worksheets("REPORT").Cells(B1 + 1, 1).Offset(0, 5) = "FORKLIFT"
Worksheets("DATA").Activate
'EMPLOYEE NAME
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Your code needs a good clean up but in terms of your immediate problem use this.

VBA Code:
ActiveCell.PasteSpecial xlPasteValues
 
Upvote 0
What about....
VBA Code:
Sub F_E_A_R()
'Forklift Expired Alignment Research
a = Worksheets("DATA").Cells(Rows.Count, 1).End(xlUp).Row
b = Worksheets("REPORT").Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False
For i = 2 To a
    If Worksheets("DATA").Cells(i, 5).Value = "EXPIRED" Or Worksheets("DATA").Cells(i, 5).Value = "SOON TO EXPIRE" Then
        Worksheets("DATA").Cells(i, 5).Offset(0, -4).Copy Worksheets("REPORT").Cells(b + 1, 1)
        With Worksheets("REPORT").Cells(b + 1, 1)
            .Value = .Value
            .Cells(b + 1, 1).Offset(0, 5) = "FORKLIFT"
        End With
    End If
    'EMPLOYEE NAME
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,217
Members
449,074
Latest member
cancansova

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