怎么向[c1] = Left([a1],Application.Find(",",[a1],1) - 1)传递参数

怎么向[c1] = Left([a1],Application.Find(",",[a1],1) - 1)传递参数
Cells(1,3) = Left(Cells(1,1),Application.Find(",",Cells(1,1),1) - 1)
[c1] = Left([a1],Application.Find(",",[a1],1) - 1)
怎么向上面的两个式子传递参数呢?定义一参数i 怎么写cells(i,2)内我写的格式系统提示有错误!
Cells(1,3) = Left(Cells(1,1),Application.Find(",",Cells(1,1),1) - 1)在VBA内使用时,会提示类型不匹配,[c1] = Left([a1],Application.Find(",",[a1],1) - 现在就是不知道怎么向这个式子传递函数,比如 我定义
dim i as integer
i=20
cells(1,3) = Left([ai],Application.Find(",",[ai],1) - 1)
就不对了 提示类型不对.你知道原因在哪里吗?
海南玲子 1年前 已收到1个回答 举报

csc9911 幼苗

共回答了16个问题采纳率:87.5% 举报

一、估计是你的i没赋值或为零引起的错误.
二、left(ss,0)因为零才出现错误.
三、Cells(1,3) = Left(Cells(1,1),Application.Find(",",Cells(1,1),1) - 1)在VBA内使用时,会提示类型不匹配,可能原因是cells(1,1)的单元格内容不包含逗号等原因引起left函数出错.
四、用到i参数的话,只能用cells格式的写法啦.

1年前

1
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.159 s. - webmaster@yulucn.com