hi guys I am newbie in vbscript I am running a code to check if there are any decimal values in ab dyn RN but I am getting an erro type mismatch for the line p=inst......
Can you guys plesae help me
Set objSheet = objExcel.ActiveWorkbook.Worksheets("dyn RN")
dim p,q ,r, isFloat3, toTest3, xlup2, nmaxrow2
xlup2=&HFFFFEFBE
nmaxrow2=objSheet.range("a65536").end(xlup2).row
objExcel.ActiveWorkbook.Worksheets("dyn RN").Range("A1:BI"&nmaxrow2).Value = objExcel.ActiveWorkbook.Worksheets("dyn RN").Range("A1:BI"&nmaxrow2).Value
isfloat3=false
toTest3 = "hello"
p=0
For q= 2 to nmaxrow2
For r=1 to 12
toTest3 = objExcel.ActiveWorkbook.Worksheets("dyn RN").cells(q,r).Value
p=instr(1,toTest3,".",vbTextCompare)----- here is the error
if p>0 and r <>9 and r<> 11 then
isFloat3=true
objtxtStream.Writeline "Decimal number in dyn RN - Row: " & q & " Column : " & r
end If
Next
Next
Can you guys plesae help me
Set objSheet = objExcel.ActiveWorkbook.Worksheets("dyn RN")
dim p,q ,r, isFloat3, toTest3, xlup2, nmaxrow2
xlup2=&HFFFFEFBE
nmaxrow2=objSheet.range("a65536").end(xlup2).row
objExcel.ActiveWorkbook.Worksheets("dyn RN").Range("A1:BI"&nmaxrow2).Value = objExcel.ActiveWorkbook.Worksheets("dyn RN").Range("A1:BI"&nmaxrow2).Value
isfloat3=false
toTest3 = "hello"
p=0
For q= 2 to nmaxrow2
For r=1 to 12
toTest3 = objExcel.ActiveWorkbook.Worksheets("dyn RN").cells(q,r).Value
p=instr(1,toTest3,".",vbTextCompare)----- here is the error
if p>0 and r <>9 and r<> 11 then
isFloat3=true
objtxtStream.Writeline "Decimal number in dyn RN - Row: " & q & " Column : " & r
end If
Next
Next