RobertHamberg
New Member
- Joined
- Jan 11, 2018
- Messages
- 34
- Office Version
- 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
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