Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automation of Keystrokes in Populated Cells.
I am seeking a way, using an Excel macro, to automatically edit a collection
of cells in the following way. {F2} {Home} " ' " {Enter} Of course if there is a better way, I would be happy to learn that also. The issue is that I repeatedly copy data from a website data page, and paste it into an Excel 2000 spreadsheet. One of the collumns of data needs to be handled as text, but the characters a nn-nnn/nn where "n" is a number. When Excel in any way processes the characters as numbers, then the cell ceases to be informative of the intended label. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automation of Keystrokes in Populated Cells.
You could select the cells and run this macro.
Sub Test dim myRange as range Dim r as range set myRange = Selection for each r in myrange r.value = "'" & r.text next r End sub -- HTH, Barb Reinhardt If this post was helpful to you, please click YES below. "Aldini" wrote: I am seeking a way, using an Excel macro, to automatically edit a collection of cells in the following way. {F2} {Home} " ' " {Enter} Of course if there is a better way, I would be happy to learn that also. The issue is that I repeatedly copy data from a website data page, and paste it into an Excel 2000 spreadsheet. One of the collumns of data needs to be handled as text, but the characters a nn-nnn/nn where "n" is a number. When Excel in any way processes the characters as numbers, then the cell ceases to be informative of the intended label. Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automation of Keystrokes in Populated Cells.
You can do it with code like
Sub AAA() Dim R As Range If TypeOf Selection Is Excel.Range Then For Each R In Selection.Cells If R.HasFormula = False Then If R.PrefixCharacter = vbNullString Then R.Value = "'" & R.Value End If End If Next R End If End Sub Select the cell(s) to modify and run the code. Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Thu, 16 Oct 2008 09:45:01 -0700, Aldini wrote: I am seeking a way, using an Excel macro, to automatically edit a collection of cells in the following way. {F2} {Home} " ' " {Enter} Of course if there is a better way, I would be happy to learn that also. The issue is that I repeatedly copy data from a website data page, and paste it into an Excel 2000 spreadsheet. One of the collumns of data needs to be handled as text, but the characters a nn-nnn/nn where "n" is a number. When Excel in any way processes the characters as numbers, then the cell ceases to be informative of the intended label. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Averaging only populated cells | Excel Worksheet Functions | |||
Cells to be populated from an workbook to another. | Excel Discussion (Misc queries) | |||
how do populate empty cells with the contents of populated cells . | Excel Discussion (Misc queries) | |||
select populated cells | Excel Programming | |||
Populated cells | Excel Programming |