Hi, can somone help me? I have script and i dont know what is wrong:
Function LastRow()
Dim c As Object
With Sheets(1).Range("A:A")
Set c = .Find(What:="*", LookIn:=xlValues, Lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlPrevious)
End With
LastRow = (c.Row)
End Function
Function inserthgbstelement(title, status, rank)
Dim funObjid As Long
objName = "hgbst_elm"
funObjid = getNextObjid(objName)
conn.Execute "insert into table_hgbst_elm(objid, TITLE, S_TITLE, RANK, STATE, DEV, INTVAL) values (funObjid, title, Upper(title), rank, status, "",0)"
inserthgbstelement = funObjid
End Function
Sub Przeszukanie_po_wierszu()
Dim c As Object
Dim x As Integer
With Sheets(1).Range("A:A")
Set c = .Find(What:="*", LookIn:=xlValues, Lookat:=xlPart, searchorder:=xlByColumns, searchdirection:=xlPrevious)
For x = 3 To LastRow
y = inserthgbstelement(Sheets(1).Range("A" + x), Sheets(1).Range("B" + x), x - 3)
Next x
End With
End Sub
Error: 13 type mismatch
if i click on debyg show me line y = inserthgbstelement(Sheets(1).Range("A" + x), Sheets(1).Range("B" + x), x - 3)
Function LastRow()
Dim c As Object
With Sheets(1).Range("A:A")
Set c = .Find(What:="*", LookIn:=xlValues, Lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlPrevious)
End With
LastRow = (c.Row)
End Function
Function inserthgbstelement(title, status, rank)
Dim funObjid As Long
objName = "hgbst_elm"
funObjid = getNextObjid(objName)
conn.Execute "insert into table_hgbst_elm(objid, TITLE, S_TITLE, RANK, STATE, DEV, INTVAL) values (funObjid, title, Upper(title), rank, status, "",0)"
inserthgbstelement = funObjid
End Function
Sub Przeszukanie_po_wierszu()
Dim c As Object
Dim x As Integer
With Sheets(1).Range("A:A")
Set c = .Find(What:="*", LookIn:=xlValues, Lookat:=xlPart, searchorder:=xlByColumns, searchdirection:=xlPrevious)
For x = 3 To LastRow
y = inserthgbstelement(Sheets(1).Range("A" + x), Sheets(1).Range("B" + x), x - 3)
Next x
End With
End Sub
Error: 13 type mismatch
if i click on debyg show me line y = inserthgbstelement(Sheets(1).Range("A" + x), Sheets(1).Range("B" + x), x - 3)