Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Deleting ' in front of text in a cell

I have several cells that I need to delete the ' in front of text in that
cell. How do I write the code for this in VBA?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Deleting ' in front of text in a cell

Hi,

Right click your sheet tab, view code and paste this in and run it.

Sub stantial()
Application.ScreenUpdating = False
For Each c In ActiveSheet.UsedRange
If Not c.HasFormula Then
c.Value = c.Text
End If
Next
Application.ScreenUpdating = True
End Sub

Mike

"iashorty" wrote:

I have several cells that I need to delete the ' in front of text in that
cell. How do I write the code for this in VBA?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Deleting ' in front of text in a cell

On 5 Jun., 22:05, iashorty wrote:
I have several cells that I need to delete the ' in front of text in that
cell. How do I write the code for this in VBA?


Hi

Look at this

Range("A1").Value = Mid(Range("A1").Value, 1)

Regards,
Per
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Deleting ' in front of text in a cell

If this is a contiguous block of data, select it and run

With Selection
.Value = .Value
End With

or this will work for everything. Select the cells and run

Dim cell As Range
For Each cell In Selection.Cells
cell.Value = cell.Value
Next

--
Tim Zych
www.higherdata.com
Compare data in worksheets and find differences with Workbook Compare
A free, powerful, flexible Excel utility



"iashorty" wrote in message
...
I have several cells that I need to delete the ' in front of text in that
cell. How do I write the code for this in VBA?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Deleting ' in front of text in a cell

Thanks, Tim. This worked for me and I was able to understand what I was doing.

IAShorty


"Tim Zych" wrote:

If this is a contiguous block of data, select it and run

With Selection
.Value = .Value
End With

or this will work for everything. Select the cells and run

Dim cell As Range
For Each cell In Selection.Cells
cell.Value = cell.Value
Next

--
Tim Zych
www.higherdata.com
Compare data in worksheets and find differences with Workbook Compare
A free, powerful, flexible Excel utility



"iashorty" wrote in message
...
I have several cells that I need to delete the ' in front of text in that
cell. How do I write the code for this in VBA?




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
Excel 2003 Macro to add text to front of data in cell Rocky Lane Excel Programming 30 September 28th 08 01:57 PM
I want to put the text in the cell of column B in front of the the text in column D. bartman1980 Excel Programming 4 August 13th 07 02:06 PM
HowTo add a period to front of EVERY text cell in a Excel column adamcollegeman Excel Programming 4 November 24th 05 07:51 AM
Formula for adding a comma in front of text in a cell Shelley Excel Worksheet Functions 4 April 18th 05 04:34 PM
Deleting Rows based on text in cell & formatting cell based on text in column beside it Steve Excel Programming 4 February 26th 04 03:31 PM


All times are GMT +1. The time now is 10:10 AM.

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"