I wrote a code to take a list of data from one Sheet to another but only place data that falls under specific criteria. it works fine but it transfer only data and not the images that are in some of the cells.
My code looks like the following:
Sub Worksheet_Activate()
Range("A4:K2000").Select
Selection.ClearContents
Range("D1").Select
i = 4
j = 4
While i <= 2000
If Worksheets("Sheet1").Cells(i, 7) = "Waterjet" Then
p = Worksheets("Sheet1").Cells(i, 1)
q = Worksheets("Sheet1").Cells(i, 2)
r = Worksheets("Sheet1").Cells(i, 3)
s = Worksheets("Sheet1").Cells(i, 4)
t = Worksheets("Sheet1").Cells(i, 5)
u = Worksheets("Sheet1").Cells(i, 6)
v = Worksheets("Sheet1").Cells(i, 7)
w = Worksheets("Sheet1").Cells(i, 8)
x = Worksheets("Sheet1").Cells(i, 9)
y = Worksheets("Sheet1").Cells(i, 10)
Z = Worksheets("Sheet1").Cells(i, 11)
Cells(j, 1) = p
Cells(j, 2) = q
Cells(j, 3) = r
Cells(j, 4) = s
Cells(j, 5) = t
Cells(j, 6) = u
Cells(j, 7) = v
Cells(j, 8) = w
Cells(j, 9) = x
Cells(j, 10) = y
Cells(j, 11) = Z
j = j + 1
Else
End If
i = i + 1
Wend
End Sub
Why the pictures in cell "q" from Worksheets("Sheet1").Cells(i, 2) are not being pasted into Cells(j, 2) = q in the Active Sheet?
My code looks like the following:
Sub Worksheet_Activate()
Range("A4:K2000").Select
Selection.ClearContents
Range("D1").Select
i = 4
j = 4
While i <= 2000
If Worksheets("Sheet1").Cells(i, 7) = "Waterjet" Then
p = Worksheets("Sheet1").Cells(i, 1)
q = Worksheets("Sheet1").Cells(i, 2)
r = Worksheets("Sheet1").Cells(i, 3)
s = Worksheets("Sheet1").Cells(i, 4)
t = Worksheets("Sheet1").Cells(i, 5)
u = Worksheets("Sheet1").Cells(i, 6)
v = Worksheets("Sheet1").Cells(i, 7)
w = Worksheets("Sheet1").Cells(i, 8)
x = Worksheets("Sheet1").Cells(i, 9)
y = Worksheets("Sheet1").Cells(i, 10)
Z = Worksheets("Sheet1").Cells(i, 11)
Cells(j, 1) = p
Cells(j, 2) = q
Cells(j, 3) = r
Cells(j, 4) = s
Cells(j, 5) = t
Cells(j, 6) = u
Cells(j, 7) = v
Cells(j, 8) = w
Cells(j, 9) = x
Cells(j, 10) = y
Cells(j, 11) = Z
j = j + 1
Else
End If
i = i + 1
Wend
End Sub
Why the pictures in cell "q" from Worksheets("Sheet1").Cells(i, 2) are not being pasted into Cells(j, 2) = q in the Active Sheet?