Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a macro that appends every record in a column

Status
Not open for further replies.

tuccokeith

Technical User
Dec 11, 2002
58
US
Hello,

I want to create a macro that adds the "'" character to every numeric value in a column b1:b1000.

For example

b1 = 2000(as a numeric value)

I want the macro to change the cell value to b1 = "'2000"

How can this be done?

Thanks
 
Here's a quick and dirty macro to do what you want:
[blue]
Code:
Sub ConvertToText()
Dim c As Range
  For Each c In Range("B1:B1000")
    If Not IsEmpty(c) Then
      c.Value = "'" & c.Text
    End If
  Next c
End Sub
[/color]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top