开发者

Stuck. I need some VBA code to insert double-quotes around strings in each cell in an excel range

开发者 https://www.devze.com 2022-12-31 15:07 出处:网络
I\'m familiar with VB.NET, but VBA in 开发者_Python百科excel has me stumped. With my best attempt, I get a \"Type mismatch\" error:

I'm familiar with VB.NET, but VBA in 开发者_Python百科excel has me stumped. With my best attempt, I get a "Type mismatch" error:

Sub AddQuotes()

    For Each x In Range("List").Cells
    x.Text = "*" * " & x.text & " & "*"
    Next

End Sub


Try using chr(34) for the double-quote character

eg chr(34) & x.text & chr(34)

0

精彩评论

暂无评论...
验证码 换一张
取 消