Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Paul987
 
Posts: n/a
Default Using &Chr$(39)& as substitute for ' in VBA


I'm trying to set the value of cells to exactly the following:

='120!TA_;|={''Sheets(3).Cells(a, 1''}'}

I seem to be having a far more difficult time with the line than I
should be.
The ' comments everything behind it out.

Sheets(3).Cells(a, 33) = ????
If someone could throw me a bone here, I'd appreciate it. TIA


--
Paul987
------------------------------------------------------------------------
Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850
View this thread: http://www.excelforum.com/showthread...hreadid=522246

  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Using &Chr$(39)& as substitute for ' in VBA

The single quote is O.K. inside a string:

Sub Macro1()
Dim s As String
s = " ' "
Cells(1, 1).Value = s
End Sub


Make your equation as a string variable and then deposit it in a cell
--
Gary''s Student


"Paul987" wrote:


I'm trying to set the value of cells to exactly the following:

='120!TA_;|={''Sheets(3).Cells(a, 1''}'}

I seem to be having a far more difficult time with the line than I
should be.
The ' comments everything behind it out.

Sheets(3).Cells(a, 33) = ????
If someone could throw me a bone here, I'd appreciate it. TIA


--
Paul987
------------------------------------------------------------------------
Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850
View this thread: http://www.excelforum.com/showthread...hreadid=522246


  #3   Report Post  
Posted to microsoft.public.excel.misc
Paul987
 
Posts: n/a
Default Using &Chr$(39)& as substitute for ' in VBA


I am having an incredibly difficult time with this. Here is an
example:

I want cell (a, 33) to equal exactly ='120.120.120.12!TA_SRV'

This does not work: "='120.120.120.12!TA_SRV'" any ideas?

My actual string is more complicated than this, but I'm hoping to be
able to extrapolate any advice receive.


--
Paul987
------------------------------------------------------------------------
Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850
View this thread: http://www.excelforum.com/showthread...hreadid=522246

  #4   Report Post  
Posted to microsoft.public.excel.misc
Paul987
 
Posts: n/a
Default Using &Chr$(39)& as substitute for ' in VBA


Anyone else have any adive for me. There seems to be a trick somewhere
that I am missing... Thx


--
Paul987
------------------------------------------------------------------------
Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850
View this thread: http://www.excelforum.com/showthread...hreadid=522246

  #5   Report Post  
Posted to microsoft.public.excel.misc
JE McGimpsey
 
Posts: n/a
Default Using &Chr$(39)& as substitute for ' in VBA

If you want the literal string

='120.120.120.12!TA_SRV'

in a cell, preformat it as text before assigning the value:

With ActiveCell
.NumberFormat = "@"
.Value = "='120.120.120.12!TA_SRV'"
End With


Alternatively, preface your string with a single quote:

ActiveCell.Value = "'='120.120.120.12!TA_SRV'"

The single quote indicates to XL that the following characters are to be
interpreted as text. You'll see the single quote in the formula bar, but
not in the cell.

OTOH, if you're trying to enter a formula,

='120.120.120.12!TA_SRV'

is not a valid formula. What formula would you successfully enter
manually?



In article ,
Paul987 wrote:

Anyone else have any adive for me. There seems to be a trick somewhere
that I am missing... Thx



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
Nesting the SUBSTITUTE formula Marco Margaritelli Excel Worksheet Functions 4 February 25th 06 02:50 PM
Substitute Formula AmyD Excel Worksheet Functions 2 January 5th 06 01:36 PM
Substitute ,replace and delete in a cell. Doug Excel Worksheet Functions 2 November 9th 05 03:50 PM
SUBSTITUTE (more than one in Excel ?) Andy100 New Users to Excel 6 September 7th 05 06:20 AM
substitute AMK Excel Worksheet Functions 1 June 13th 05 01:23 AM


All times are GMT +1. The time now is 02:33 PM.

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

About Us

"It's about Microsoft Excel"