New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

store any name without double quote

Macros, VBA, Excel Automation, etc.

store any name without double quote

Postby nileshjadhavshiv » Tue Aug 23, 2016 1:22 pm

Hi All

How can i store any name without double quote ?


Sub Test

MyNAme = range("A1").value 'Range("A1").value = "Peter"

End sub

When i am move cursor on MyNAme is showing "Peter" but i want only peter without double quotes.
I had store myname in string but get same thing.

KIndly help me asap
  • 0

nileshjadhavshiv
Rookie
 
Posts: 8
Joined: Jul 9, 2015
Reputation: 0
Excel Version: 2010

Re: store any name without double quote

Postby charles » Sun Aug 28, 2016 7:29 pm

Hi,

When you hover over "Myname" it will show "Peter".
Now if you have in your code to place Myname in range("A2") it will show Peter.

Code: Select all
Sub test()
myname = Range("A1").Value
Range("A2").Value = myname
End Sub
  • 0

There are other ways too do this but...

Be kind let us know if you posted somewhere else!



Charles
charles
Excel Badass
 
Posts: 632
Joined: Dec 10, 2011
Location: Mississippi
Reputation: 1
Excel Version: Excel 2003, 2007 and Mac 2011

Re: store any name without double quote

Postby charles » Sun Sep 04, 2016 12:33 pm

  • 0

There are other ways too do this but...

Be kind let us know if you posted somewhere else!



Charles
charles
Excel Badass
 
Posts: 632
Joined: Dec 10, 2011
Location: Mississippi
Reputation: 1
Excel Version: Excel 2003, 2007 and Mac 2011

Re: store any name without double quote

Postby nileshjadhavshiv » Mon Sep 05, 2016 5:12 am

Thanks Charles for your code.
  • 0

nileshjadhavshiv
Rookie
 
Posts: 8
Joined: Jul 9, 2015
Reputation: 0
Excel Version: 2010


Return to Macros and VBA Questions

Who is online

Users browsing this forum: No registered users and 11 guests