Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
jnycks
 
Posts: n/a
Default how do I insert an ' in front of many rows of numbers?

I have a column of numbers 1,800 rows long that needs an ' in front of every
row. How do I do this?
  #2   Report Post  
Peter Rooney
 
Posts: n/a
Default

Hold down [Alt]+F11
From the menu "Insert", "Module"
Copy and paste this code into the module
Hold down [Alt]+F11 to go back to your workbook
Select the cells to which you want to add an apostrophe
Hold down [Alt]+F8
Double Click "AddApostropheToRange"

This should do it.

Hope this helps

Pete

Sub AddApostropheToRange()
Dim CellToModify As Object
For Each CellToModify In Selection
CellToModify.Formula = "'" & CellToModify.Formula
Next CellToModify
End Sub

Note Line 4 contains an apostrophe surrounded by double quotes



"jnycks" wrote:

I have a column of numbers 1,800 rows long that needs an ' in front of every
row. How do I do this?

  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default


If you just need them to be text, format the column as text.

If you need that extra character

iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 to iLastRow
Cells(i,"A").Value = "'" & Cells(i,"A").Value
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"jnycks" wrote in message
...
I have a column of numbers 1,800 rows long that needs an ' in front of

every
row. How do I do this?



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
Insert rows based on specific value bob Excel Worksheet Functions 6 February 29th 08 07:11 PM
can't insert more rows even though not at max rows nikkiamber Excel Worksheet Functions 3 April 4th 05 10:45 PM
Insert rows Mr. G. Excel Worksheet Functions 3 March 31st 05 03:49 AM
INSERT ROWS WITHOUT SCREWING-UP FORMULAS! BILL GATES - I WANNA WORD WITH YOU! Excel Worksheet Functions 1 March 4th 05 01:32 PM
Challenging Charting C TO Charts and Charting in Excel 0 January 17th 05 06:57 PM


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

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"