Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Add = sign to table of numbers
I have a large table with numbers only in it i.e. 1234.5
I need to make these numbers part of a formula now by adding an equal sign to each number in the table i.e. =1234.5+L62. Is there a way to have Excel add the = sign to the cells without having to go into each cell and manually add it? Thanks for any suggestions. -- Dewayne |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Add = sign to table of numbers
This code will take a selected group of cells and add an = symbol to the
beginning of them. Only tested with cells containing numbers/empty cells. Probably create incredible errors if you use it with cells containing text. Open the workbook, press [Alt]+[F11] to open the VB Editor. In the VBE, choose Insert -- Module and copy and paste the code below into the new module. Close the VB Editor. Select the cells you need to add the= symbol to and then use Tools -- Macro -- Macros to run the code. I'll leave it to you to add the "+L..." since I assume that the row number is probably going to change. But if it was always to be "+L62" then you could change the one line below to: anyCell.Formula = "=" & anyCell.Value & "+L62" Sub MakeItAFormula() 'select the cells you want to change 'and then call this routine from ' Tools -- Macro -- Macros Dim anyCell As Range For Each anyCell In Selection If Not IsEmpty(anyCell) And _ Not anyCell.HasFormula Then anyCell.Formula = "=" & anyCell.Value End If Next End Sub "Dewayne" wrote: I have a large table with numbers only in it i.e. 1234.5 I need to make these numbers part of a formula now by adding an equal sign to each number in the table i.e. =1234.5+L62. Is there a way to have Excel add the = sign to the cells without having to go into each cell and manually add it? Thanks for any suggestions. -- Dewayne |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Add = sign to table of numbers
Thank you J
-- Dewayne "JLatham" wrote: This code will take a selected group of cells and add an = symbol to the beginning of them. Only tested with cells containing numbers/empty cells. Probably create incredible errors if you use it with cells containing text. Open the workbook, press [Alt]+[F11] to open the VB Editor. In the VBE, choose Insert -- Module and copy and paste the code below into the new module. Close the VB Editor. Select the cells you need to add the= symbol to and then use Tools -- Macro -- Macros to run the code. I'll leave it to you to add the "+L..." since I assume that the row number is probably going to change. But if it was always to be "+L62" then you could change the one line below to: anyCell.Formula = "=" & anyCell.Value & "+L62" Sub MakeItAFormula() 'select the cells you want to change 'and then call this routine from ' Tools -- Macro -- Macros Dim anyCell As Range For Each anyCell In Selection If Not IsEmpty(anyCell) And _ Not anyCell.HasFormula Then anyCell.Formula = "=" & anyCell.Value End If Next End Sub "Dewayne" wrote: I have a large table with numbers only in it i.e. 1234.5 I need to make these numbers part of a formula now by adding an equal sign to each number in the table i.e. =1234.5+L62. Is there a way to have Excel add the = sign to the cells without having to go into each cell and manually add it? Thanks for any suggestions. -- Dewayne |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Add = sign to table of numbers
Glad I was able to make things a bit easier for you.
"Dewayne" wrote: Thank you J -- Dewayne "JLatham" wrote: This code will take a selected group of cells and add an = symbol to the beginning of them. Only tested with cells containing numbers/empty cells. Probably create incredible errors if you use it with cells containing text. Open the workbook, press [Alt]+[F11] to open the VB Editor. In the VBE, choose Insert -- Module and copy and paste the code below into the new module. Close the VB Editor. Select the cells you need to add the= symbol to and then use Tools -- Macro -- Macros to run the code. I'll leave it to you to add the "+L..." since I assume that the row number is probably going to change. But if it was always to be "+L62" then you could change the one line below to: anyCell.Formula = "=" & anyCell.Value & "+L62" Sub MakeItAFormula() 'select the cells you want to change 'and then call this routine from ' Tools -- Macro -- Macros Dim anyCell As Range For Each anyCell In Selection If Not IsEmpty(anyCell) And _ Not anyCell.HasFormula Then anyCell.Formula = "=" & anyCell.Value End If Next End Sub "Dewayne" wrote: I have a large table with numbers only in it i.e. 1234.5 I need to make these numbers part of a formula now by adding an equal sign to each number in the table i.e. =1234.5+L62. Is there a way to have Excel add the = sign to the cells without having to go into each cell and manually add it? Thanks for any suggestions. -- Dewayne |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Reverse Sign of A Column of Numbers | Excel Discussion (Misc queries) | |||
Comparing numbers, ignoring sign | Excel Discussion (Misc queries) | |||
display plus sign on plus numbers in Excel | Excel Discussion (Misc queries) | |||
How do I convert numbers to the opposite sign? | Excel Discussion (Misc queries) | |||
Align $ sign next to numbers | Excel Discussion (Misc queries) |