Please Help Me
Excel error 1004 “Unable to get … property of WorksheetFunction class”
This My Code
Excel error 1004 “Unable to get … property of WorksheetFunction class”
This My Code
VBA Code:
Sub variasi()
Dim i, j
Dim sData As Worksheet: Set sData = Sheets("Data Scrape")
Application.Calculation = xlCalculationManual
With sData
For i = 2 To .Range("A" & Rows.Count).End(xlUp).Row
SKU = Sheets("Data Edit").Range("F18") & WorksheetFunction.Rept("0", 3 - Len(i - 1)) & i - 1
produk = .Range("A" & i)
harga = .Range("B" & i)
berat = .Range("C" & i)
deskripsi = .Range("D" & i)
gbr1 = .Range("E" & i)
gbr2 = .Range("F" & i)
gbr3 = .Range("G" & i)
gbr4 = .Range("H" & i)
gbr5 = .Range("I" & i)
AssSKU = SKU & "-" & .Range("J" & i)
For j = 10 To 100
n = j Mod 3
If n = 1 Then
Var = .Cells(i, j)
If Len(Var) = 0 And j = 10 Then
x = Range("A" & Rows.Count).End(xlUp).Row + 1
Cells(x, 1) = i - 1
Cells(x, 2) = product
Cells(x, 3) = price
Cells(x, 4) = brt
Cells(x, 5) = desk
Cells(x, 6) = gbr1
Cells(x, 7) = gbr2
Cells(x, 8) = gbr3
Cells(x, 9) = gbr4
Cells(x, 10) = gbr5
Cells(x, 11) = SKU & "-" & "Not Specified"
Cells(x, 12) = SKU & "-" & "Not Specified"
Cells(x, 13) = "Not Specified"
Cells(x, 14) = price
Cells(x, 15) = 1000
Range("A5:O10000").WrapText = False
ElseIf Len(Var) Then
x = Range("A" & Rows.Count).End(xlUp).Row + 1
Cells(x, 1) = i - 1
Cells(x, 2) = product
Cells(x, 3) = price
Cells(x, 4) = brt
Cells(x, 5) = desk
Cells(x, 6) = gbr1
Cells(x, 7) = gbr2
Cells(x, 8) = gbr3
Cells(x, 9) = gbr4
Cells(x, 10) = gbr5
Cells(x, 11) = AssSKU
Cells(x, 12) = SKU & "-" & Var
Cells(x, 13) = .Cells(i, j)
Cells(x, 14) = .Cells(i, j + 1)
Cells(x, 15) = .Cells(i, j + 2)
Range("A5:O10000").WrapText = False
End If
End If
Next j
Next i
End With
Application.Calculation = xlCalculationAutomatic
End Sub