Deleting ' in front of text in a cell

  • Thread starter Thread starter iashorty
  • Start date Start date
I

iashorty

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,

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
 
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
 
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
 
Thanks, Tim. This worked for me and I was able to understand what I was doing.

IAShorty
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top