Adjust copy-formula to not include format

RobertHamberg

New Member
Joined
Jan 11, 2018
Messages
34
Office Version
  1. 365
How do I adjust this script so it doesnt paste format and only values?

Sub Spara_Statistik_Vecka()
' Det här makrot kopierar veckostatistik till historik
Dim Fnd As Range
With Sheets("Tjänster")
Set Fnd = Sheets("Tjänster").Range("N1:XFD1").Find(.Range("C2").Value, , , xlWhole, , , False, , False)
If Not Fnd Is Nothing Then
.Range("C6:C8").Copy Sheets("Tjänster").Cells(6, Fnd.Column)
.Range("C10").Copy Sheets("Tjänster").Cells(10, Fnd.Column)
.Range("C13:C14").Copy Sheets("Tjänster").Cells(13, Fnd.Column)
.Range("C16").Copy Sheets("Tjänster").Cells(16, Fnd.Column)
.Range("C19:C23").Copy Sheets("Tjänster").Cells(19, Fnd.Column)
.Range("C25").Copy Sheets("Tjänster").Cells(25, Fnd.Column)
.Range("C28:C30").Copy Sheets("Tjänster").Cells(28, Fnd.Column)
.Range("C32").Copy Sheets("Tjänster").Cells(32, Fnd.Column)
.Range("C35:C37").Copy Sheets("Tjänster").Cells(35, Fnd.Column)
.Range("C39").Copy Sheets("Tjänster").Cells(39, Fnd.Column)
Else
MsgBox .Range("C2").Value & " hittades inte."
End If
End With
ThisWorkbook.RefreshAll
End Sub
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
To get values only use
Code:
         .Cells(6, Fnd.Column).Resize(3).Value = .Range("C6:C8").Value
         .Cells(10, Fnd.Column).Value = .Range("C10").Value
         .Cells(13, Fnd.Column).Resize(2).Value = .Range("C13:C14").Value
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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