Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I want to replace single quote in my excel worksheet using replace function. The way I am using at the moment to replace blank spaces to empty spaces in one entire column is newSheet.Columns("A").Replace " ", "", xlPart I would like to do the same with text containing single quote e.g """PNL """"W"""" TRANSFE to PNLWTRANSFE What do you put in for the substring to search for? thanks in advance Galantis -- galantis ------------------------------------------------------------------------ galantis's Profile: http://www.excelforum.com/member.php...o&userid=24739 View this thread: http://www.excelforum.com/showthread...hreadid=383053 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Galantis,
try this: Selection.Replace Chr$(34), "", xlPart |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Any time you need to put a quote mark into a literal string you simply double
it up, like this: MyString = "I want to say ""Hello"" to you" Therefore to search for a single quote mark in the Replace function you need four quote marks like this: NewString = Replace(OldString, """", "") (Example is of the VB Replace function) Why four quotes marks? The first is the opening quote mark for the literal string value, the next two are the doubled-up quote mark within the literal string, and the last is the closing quote mark to end the literal string. Clear as mud? "galantis" wrote: Hi, I want to replace single quote in my excel worksheet using replace function. The way I am using at the moment to replace blank spaces to empty spaces in one entire column is newSheet.Columns("A").Replace " ", "", xlPart I would like to do the same with text containing single quote e.g """PNL """"W"""" TRANSFE to PNLWTRANSFE What do you put in for the substring to search for? thanks in advance Galantis -- galantis ------------------------------------------------------------------------ galantis's Profile: http://www.excelforum.com/member.php...o&userid=24739 View this thread: http://www.excelforum.com/showthread...hreadid=383053 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() thanks for the reply and it works! now, how do you catch the error generated when find and replacing substring that does not exist? a Null I do not want a error pop-up message box which stops my marco. galantis -- galantis ------------------------------------------------------------------------ galantis's Profile: http://www.excelforum.com/member.php...o&userid=24739 View this thread: http://www.excelforum.com/showthread...hreadid=383053 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() it's okay, I found a similar item been asked from this forum and I will try to use it. thanks. galantis. -- galantis ------------------------------------------------------------------------ galantis's Profile: http://www.excelforum.com/member.php...o&userid=24739 View this thread: http://www.excelforum.com/showthread...hreadid=383053 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() thanks, suggestions works! but now, how do I catch the error if the find and replace substring don't find anything? returns a null? I do not want a pop-up message box which stops my marco. galantis -- galantis ------------------------------------------------------------------------ galantis's Profile: http://www.excelforum.com/member.php...o&userid=24739 View this thread: http://www.excelforum.com/showthread...hreadid=383053 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I used to have a chart with all the keyboard alpha, numeric, and symbol
characters. I would like to know where to find the numeric value for this. Chr$(34) I can't find the Chr$ anywhere. "Roman" wrote: Hi Galantis, try this: Selection.Replace Chr$(34), "", xlPart |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The result can vary depending on the font used, but you can do the
following: in A1, enter =CHAR(ROW()) and fill this down to A255. Now, you can make the symbols larger, obviously, by increasing the font of the column, to, say, 14 pt. - The first 32 rows or so will mainly just show a little square, but scroll down. Now, you can copy column A out to Columns B & beyond, and format each column as a new font to see different symbols, especially Wingdings, etc. You can use this chart to know how to enter the symbol directly. For example, to enter a ¢ sign, you can see it's on row 162, so you can hold the Alt key, and type 0162 from the numeric keypad (leading 0 important), then let go of the Alt key and the symbol will appear. Bob Umlas Excel MVP "lschuh" wrote in message ... I used to have a chart with all the keyboard alpha, numeric, and symbol characters. I would like to know where to find the numeric value for this. Chr$(34) I can't find the Chr$ anywhere. "Roman" wrote: Hi Galantis, try this: Selection.Replace Chr$(34), "", xlPart |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thank you. that's pretty neat.
"Bob Umlas" wrote: The result can vary depending on the font used, but you can do the following: in A1, enter =CHAR(ROW()) and fill this down to A255. Now, you can make the symbols larger, obviously, by increasing the font of the column, to, say, 14 pt. - The first 32 rows or so will mainly just show a little square, but scroll down. Now, you can copy column A out to Columns B & beyond, and format each column as a new font to see different symbols, especially Wingdings, etc. You can use this chart to know how to enter the symbol directly. For example, to enter a ¢ sign, you can see it's on row 162, so you can hold the Alt key, and type 0162 from the numeric keypad (leading 0 important), then let go of the Alt key and the symbol will appear. Bob Umlas Excel MVP "lschuh" wrote in message ... I used to have a chart with all the keyboard alpha, numeric, and symbol characters. I would like to know where to find the numeric value for this. Chr$(34) I can't find the Chr$ anywhere. "Roman" wrote: Hi Galantis, try this: Selection.Replace Chr$(34), "", xlPart |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can the SUBSTITUTE function replace a double quote? | Excel Worksheet Functions | |||
vlookup and using single quote | Excel Worksheet Functions | |||
using a single quote ' in SEARCH function | Excel Worksheet Functions | |||
Removing leading single quote (') from cells with Search/Replace | Excel Discussion (Misc queries) | |||
Single quote in a where clause | Excel Programming |