Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default 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
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
Reverse Sign of A Column of Numbers Lee Excel Discussion (Misc queries) 1 March 6th 07 01:58 AM
Comparing numbers, ignoring sign steev_jd Excel Discussion (Misc queries) 3 April 18th 06 10:44 AM
display plus sign on plus numbers in Excel tnoble Excel Discussion (Misc queries) 1 November 19th 05 02:28 PM
How do I convert numbers to the opposite sign? CindyatRWD Excel Discussion (Misc queries) 3 October 24th 05 03:24 PM
Align $ sign next to numbers Christina Excel Discussion (Misc queries) 5 April 7th 05 07:21 PM


All times are GMT +1. The time now is 01:05 PM.

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"