Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Substituting CRLF with "+" - Transforming a cell containing numbersin a sum of its numbers

Hi,

I have a 1000 row table in excel with a field that has several numbers in the same cell, like:

3
451
10

I need to add these numbers together so I was trying to transform this into a formula: Adding a "+" sign in the beggining is trivial bu how can I put a "+" i n front of 451 and 10 so that I can transform this field in a sum of its numbers?

for instance: I think between 3 and 451 there is a CRLF. Is it possible to find/replace this char by a "+" sign? Other ways?

Thanks/Brgds
joao
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Substituting CRLF with "+" - Transforming a cell containing numbers in a sum of its numbers

Hi,

Am Tue, 26 Nov 2013 06:00:59 -0800 (PST) schrieb JJ:

3
451
10

I need to add these numbers together so I was trying to transform this into a formula: Adding a "+" sign in the beggining is trivial bu how can I put a "+" i n front of 451 and 10 so that I can transform this field in a sum of its numbers?


your values in column A (or modify the range to suit):

Sub Test()
Dim LRow As Long
Dim rngC As Range

LRow = Cells(Rows.Count, 1).End(xlUp).Row
For Each rngC In Range("A1:A" & LRow)
rngC = "=" & Replace(rngC, Chr(10), "+")
Next
With Range("A1:A" & LRow)
.WrapText = False
.EntireRow.AutoFit
End With
End Sub


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Substituting CRLF with "+" - Transforming a cell containing numbers in a sum of its numbers

Hi,

I have a 1000 row table in excel with a field that has several
numbers in the same cell, like:

3
451
10

I need to add these numbers together so I was trying to transform
this into a formula: Adding a "+" sign in the beggining is trivial bu
how can I put a "+" i n front of 451 and 10 so that I can transform
this field in a sum of its numbers?

for instance: I think between 3 and 451 there is a CRLF. Is it
possible to find/replace this char by a "+" sign? Other ways?

Thanks/Brgds
joao


What you need here is to impliment 'formula-style' input so you have
both a record of each value as well as the total displayed...

=3+451+10

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

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
Convert numbers to date: "586" to read "May 1986" CEckels Excel Worksheet Functions 5 May 14th 09 04:46 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
any formula to convert numbers in word form, e.g. "2" as "Two"? Neeraj Excel Worksheet Functions 1 May 26th 08 01:03 PM
Validation ?:Accepting both Numbers AND specific letters("N","n"," Antonio Excel Discussion (Misc queries) 2 April 22nd 08 05:07 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"