I get error 1004 on this snippet of code. Plz help!
Code:
Dim Cert2008, Cert2009, Cert2010, Cert2011, Cert2012, Cert2013, Cert2014, Cert2015, Cert2016, Cert2017, Cert2018, Cert2019, Cert2020, Cert2021, Cert2022, Cert2023, Cert2024, Cert2025, Cert2026, Cert2027, Cert2028, Cert2029, Cert2030 As Integer
Dim certused(), Check As Variant
Dim certcounter As Integer
certcounter=0
' ======= SKIPPED WORKING PART=========
' === Get data =======
ActiveCell.Offset(0, 3).Range("A1").Select
Check = ActiveCell.Value
'== Check if exist =======
lngLoc = Application.WorksheetFunction.Match(Check, certused(certcounter), 0)
If Not IsEmpty(lngLoc) Then
Else
'===== Add to string ===
ReDim Preserve certused(certcounter + 1)
certused(certcounter) = ActiveCell.Value
'=== Prepare for next ======
certcounter = certcounter + 1
Cert2008 = Cert2008 + 1
End If
ActiveCell.Offset(0, -3).Range("A1").Select