Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default I need to put text in quotes(")

Thanks for all inputs so far and sorry this is a seperate thread.
I am nearly there.....
I have:-
CellSel = Range("E1")
i = ActiveSheet.Shapes.Count
Line1 = "Sub CommandButton" & i & "_Click"
With ActiveWorkbook.VBProject.VBComponents(ActiveSheet. CodeName).CodeModule
X = .CountOfLines
.InsertLines X + 1, Line1
.InsertLines X + 2, "d=" & CellSel
.InsertLines X + 3, "End Sub"
End With

where cell E1 contains text Hello and i=1 in this case.
This give me the commandbutton code of:-
Sub CommandButton1_Click()
d=Hello
End Sub

But I need the Hello in quotes ("Hello")....d= "Hello". How can I do this.
Cheers Folkes.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default I need to put text in quotes(")

CellSel = char(34) & Range("E1").Text & char(34)

--
Regards,
Tom Ogilvy


"Donna" wrote in message
om...
Thanks for all inputs so far and sorry this is a seperate thread.
I am nearly there.....
I have:-
CellSel = Range("E1")
i = ActiveSheet.Shapes.Count
Line1 = "Sub CommandButton" & i & "_Click"
With

ActiveWorkbook.VBProject.VBComponents(ActiveSheet. CodeName).CodeModule
X = .CountOfLines
.InsertLines X + 1, Line1
.InsertLines X + 2, "d=" & CellSel
.InsertLines X + 3, "End Sub"
End With

where cell E1 contains text Hello and i=1 in this case.
This give me the commandbutton code of:-
Sub CommandButton1_Click()
d=Hello
End Sub

But I need the Hello in quotes ("Hello")....d= "Hello". How can I do

this.
Cheers Folkes.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default I need to put text in quotes(")

I bet Tom meant:

CellSel = chr(34) & Range("E1").Text & chr(34)

(chr() instead of char())

Tom Ogilvy wrote:

CellSel = char(34) & Range("E1").Text & char(34)

--
Regards,
Tom Ogilvy

"Donna" wrote in message
om...
Thanks for all inputs so far and sorry this is a seperate thread.
I am nearly there.....
I have:-
CellSel = Range("E1")
i = ActiveSheet.Shapes.Count
Line1 = "Sub CommandButton" & i & "_Click"
With

ActiveWorkbook.VBProject.VBComponents(ActiveSheet. CodeName).CodeModule
X = .CountOfLines
.InsertLines X + 1, Line1
.InsertLines X + 2, "d=" & CellSel
.InsertLines X + 3, "End Sub"
End With

where cell E1 contains text Hello and i=1 in this case.
This give me the commandbutton code of:-
Sub CommandButton1_Click()
d=Hello
End Sub

But I need the Hello in quotes ("Hello")....d= "Hello". How can I do

this.
Cheers Folkes.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default I need to put text in quotes(")

Details, details -- Thanks for the correction!

--
Regards,
Tom Ogilvy

"Dave Peterson" wrote in message
...
I bet Tom meant:

CellSel = chr(34) & Range("E1").Text & chr(34)

(chr() instead of char())

Tom Ogilvy wrote:

CellSel = char(34) & Range("E1").Text & char(34)

--
Regards,
Tom Ogilvy

"Donna" wrote in message
om...
Thanks for all inputs so far and sorry this is a seperate thread.
I am nearly there.....
I have:-
CellSel = Range("E1")
i = ActiveSheet.Shapes.Count
Line1 = "Sub CommandButton" & i & "_Click"
With

ActiveWorkbook.VBProject.VBComponents(ActiveSheet. CodeName).CodeModule
X = .CountOfLines
.InsertLines X + 1, Line1
.InsertLines X + 2, "d=" & CellSel
.InsertLines X + 3, "End Sub"
End With

where cell E1 contains text Hello and i=1 in this case.
This give me the commandbutton code of:-
Sub CommandButton1_Click()
d=Hello
End Sub

But I need the Hello in quotes ("Hello")....d= "Hello". How can I do

this.
Cheers Folkes.


--

Dave Peterson



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MSN stock quotes - Error message "problem displaying attributes" jd Excel Discussion (Misc queries) 0 November 13th 07 10:34 PM
how to copy contents of a cell and remove any quotes " " jonny Excel Discussion (Misc queries) 2 January 28th 07 06:48 PM
"MSN MONEY STOCK QUOTES" NOT OPENING IN 2002 [email protected] Excel Worksheet Functions 0 December 11th 06 06:21 PM
"formula is too long" AND test for whether double-quotes are next-to text or number?? The Moose Excel Discussion (Misc queries) 2 September 14th 06 05:29 AM
Saving as Text (tab delimited) surrounds text with "quotes" Mike521 Excel Discussion (Misc queries) 2 June 8th 06 02:28 PM


All times are GMT +1. The time now is 09:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"