Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Can I remove prefix apostrophe

Hi,

I have a spreadsheet that is exported from a database, and all of the cells
have an apostrophe prefix. The apostrophe keeps hyperlinks from functioning
(since they are now considered text). Here is the code I have created to
remove the apostrophe - unfortunately it removes the first actual character
in the cell as well as the apostrophe:

Public Sub ParseApostrophe1()

Dim Cell As Range

Worksheets("customers").Activate
ActiveCell.CurrentRegion.Select

For Each Cell In Selection
If Len(Cell.Value) = 1 And Cell.PrefixCharacter = "'" Then
Cell.Value = Right(Cell, Len(Cell) - 1)
End If
Next Cell

End Sub

Does anyone have an idea how I can get rid of the apostrophe without
deleting the first actual (visual) character in the cell.

TIA

Best regards,
Bill

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can I remove prefix apostrophe


I have not tried to write a procedure to do what you are asking, but I
have used the search & replace from within the spreadsheet to replace
everything matching the search criteria.

I don't know if any of your hyperlinks have an apostrophe in the
address itself. Wouldn't seem likely?

Make a backup copy before your do try this.


--
DCSwearingen


------------------------------------------------------------------------
DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506
View this thread: http://www.excelforum.com/showthread...hreadid=501234

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Can I remove prefix apostrophe

I'd replace:

Cell.Value = Right(Cell, Len(Cell) - 1)

with these lines:

with Cell
.numberformat = "@" 'keep it text
.value = .value
end with



swansonwc wrote:

Hi,

I have a spreadsheet that is exported from a database, and all of the cells
have an apostrophe prefix. The apostrophe keeps hyperlinks from functioning
(since they are now considered text). Here is the code I have created to
remove the apostrophe - unfortunately it removes the first actual character
in the cell as well as the apostrophe:

Public Sub ParseApostrophe1()

Dim Cell As Range

Worksheets("customers").Activate
ActiveCell.CurrentRegion.Select

For Each Cell In Selection
If Len(Cell.Value) = 1 And Cell.PrefixCharacter = "'" Then
Cell.Value = Right(Cell, Len(Cell) - 1)
End If
Next Cell

End Sub

Does anyone have an idea how I can get rid of the apostrophe without
deleting the first actual (visual) character in the cell.

TIA

Best regards,
Bill


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Can I remove prefix apostrophe

Dave,

That worked perfectly.

Thank you for your help.

Best regards,
Bill

"Dave Peterson" wrote:

I'd replace:

Cell.Value = Right(Cell, Len(Cell) - 1)

with these lines:

with Cell
.numberformat = "@" 'keep it text
.value = .value
end with



swansonwc wrote:

Hi,

I have a spreadsheet that is exported from a database, and all of the cells
have an apostrophe prefix. The apostrophe keeps hyperlinks from functioning
(since they are now considered text). Here is the code I have created to
remove the apostrophe - unfortunately it removes the first actual character
in the cell as well as the apostrophe:

Public Sub ParseApostrophe1()

Dim Cell As Range

Worksheets("customers").Activate
ActiveCell.CurrentRegion.Select

For Each Cell In Selection
If Len(Cell.Value) = 1 And Cell.PrefixCharacter = "'" Then
Cell.Value = Right(Cell, Len(Cell) - 1)
End If
Next Cell

End Sub

Does anyone have an idea how I can get rid of the apostrophe without
deleting the first actual (visual) character in the cell.

TIA

Best regards,
Bill


--

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
Remove Apostrophe from end of number octet Excel Discussion (Misc queries) 4 April 22nd 08 06:22 PM
Remove Trailing Apostrophe Dave P Excel Discussion (Misc queries) 1 August 10th 07 12:42 AM
how to remove the apostrophe Tiffany Excel Discussion (Misc queries) 3 April 17th 07 09:54 AM
'09:00AM trying to get remove the apostrophe Kazza Excel Discussion (Misc queries) 1 April 25th 06 10:57 AM
Remove apostrophe Pat Excel Worksheet Functions 2 September 11th 05 06:27 PM


All times are GMT +1. The time now is 01:05 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"