-
Apr 30th, 2013, 07:36 AM
#1
Thread Starter
Junior Member
[RESOLVED] visual basic script
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)
-
Apr 30th, 2013, 01:43 PM
#2
Re: visual basic script
Concatenate strings using the & operator, not the + operator:
Code:
y = inserthgbstelement(Sheets(1).Range("A" & x), Sheets(1).Range("B" & x), x - 3)
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
May 7th, 2013, 02:54 AM
#3
Thread Starter
Junior Member
Re: visual basic script
thank you. I change this
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|