• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

SendKeys not working

Sub test()
dim v1 as Variant
v1 = "ram(Shyam)"
SendKeys v1
End Sub

But instead of "ram(Shyam)" it comes only "ramShyam"
So please someone help how we can press "(" or ")" along with other text through SendKes.
 
Hi Mohan,
Firstly welcome the forum Chandoo.org...

I don't know much about VBA, and I don't know the purpose of sendkeys in your code, i just replaced sendkeys with activecell.value=:

Code:
Sub test()
Dim v1 As Variant
v1 = "ram(Shyam)"
ActiveCell.Value = v1
End Sub

Pardon if it does not meets your requirement, hope someone will provide you better help.

Regards,
 
Hi Mohan,
Firstly welcome the forum Chandoo.org...

I don't know much about VBA, and I don't know the purpose of sendkeys in your code, i just replaced sendkeys with activecell.value=:

Code:
Sub test()
Dim v1 As Variant
v1 = "ram(Shyam)"
ActiveCell.Value = v1
End Sub

Pardon if it does not meets your requirement, hope someone will provide you better help.

Regards,
Actually I am trying to write the value stored in v1 to some other application where copy/paste is not allowed. Thanks anyway!!
 
Hi ,

This will work :
Code:
Sub test()
    Dim v1 As String
    v1 = "ram+9Shyam+0{ENTER}"
    SendKeys v1
End Sub
The PLUS sign + signifies that the SHIFT key is to be pressed , and the character which follows is then pressed ; hence to get the left parenthesis , you need to keep the SHIFT key pressed and press the 9 key ; similarly , to get the right parenthesis , you need to keep the SHIFT key pressed and press the 0 key.

Narayan
 
Back
Top