Hello,
I'm wondering how to fix that, tried many things to declare ranges within sheets but still getting 438/1004 error and can't deal with that.
I'm getting error at Paste line
There is last-saved code, I tried many of things just like using "With worksheet" method. Usually I'm trying to deal with problems solo but I know that you're always come with right help and I need that.
Thanks a lot
I'm wondering how to fix that, tried many things to declare ranges within sheets but still getting 438/1004 error and can't deal with that.
Sub createLabel()
Dim ws As Worksheet
Dim wsLabel As Worksheet
Dim lastCol As Integer
Dim i As Integer
Dim k As Integer
Dim j As Integer
Dim cell As Range
lastCol = ActiveWorkbook.Worksheets("Cheatsheet").Cells(1, Columns.Count).End(xlToLeft).Column
With ThisWorkbook
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Label"
End With
i = 1
j = i + 2
Worksheets("Label").Activate
Set wsLabel = Sheets("Label")
Worksheets("Cheatsheet").Activate
Set ws = Sheets("Cheatsheet")
For k = 8 To lastCol
Set cell = Worksheets("Cheatsheet").Range(Worksheets("Cheatsheet").Cells(3, k), Cells(3, k))
If InStr(cell.Value, "Part") > 0 Then
Worksheets("Cheatsheet").Range(Worksheets("Cheatsheet").Cells(3, k), Cells(5, k)).Copy
Range(Worksheets("Label").Cells(i, 1), Cells(j, 1)).Paste
i = i + 4
Else
End If
Next k
End Sub
I'm getting error at Paste line
There is last-saved code, I tried many of things just like using "With worksheet" method. Usually I'm trying to deal with problems solo but I know that you're always come with right help and I need that.
Thanks a lot
Last edited: