ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   sum character (https://www.excelbanter.com/charts-charting-excel/447823-sum-character.html)

bing

sum character
 
I have this situation:
Adress cell value
A10 A
A20 B
A30 C
A40 D
A50 E
A60 F
A70 G

I want to merge value all cell from A0 to A79 and put in cell A80 as
SUM(A0:A79) in numeric.
I want that value in cell A80 is ABCDEF.
For example
If delete row A30 value in A79(before A80) is ABDEF
If add row A20 and put value in cell X, value in A81(before A80) is AXBCDEF
Do you have any idea

Bing


plinius

sum character
 
Il 12/12/2012 10:33, Bing ha scritto:
I have this situation:
Adress cell value
A10 A
A20 B
A30 C
A40 D
A50 E
A60 F
A70 G

I want to merge value all cell from A0 to A79 and put in cell A80 as
SUM(A0:A79) in numeric.
I want that value in cell A80 is ABCDEF.
For example
If delete row A30 value in A79(before A80) is ABDEF
If add row A20 and put value in cell X, value in A81(before A80) is AXBCDEF
Do you have any idea

Bing


-----------------
Function SumC(rng As Range) As String
Dim c As Range
For Each c In rng
SumC = SumC & c
Next
End Function
-----------------

Hi,
E.

bing

sum character
 
-----------------
Function SumC(rng As Range) As String
Dim c As Range
For Each c In rng
SumC = SumC & c
Next
End Function
-----------------

Sub sum()
Dim c As Range
For Each c In Range("E770:E790")
SumC = SumC & c
Next
ActiveCell.Value = SumC
End Sub

Thanks. It works

Another question
I want to select range with mouse instead of ("E770:E790")


plinius

sum character
 
Il 12/12/2012 12:11, Bing ha scritto:
-----------------
Function SumC(rng As Range) As String
Dim c As Range
For Each c In rng
SumC = SumC & c
Next
End Function
-----------------

Sub sum()
Dim c As Range
For Each c In Range("E770:E790")
SumC = SumC & c
Next
ActiveCell.Value = SumC
End Sub

Thanks. It works

Another question
I want to select range with mouse instead of ("E770:E790")


You can use "selection" instead of "E770:E790"

bing

sum character
 
-----------------
Function SumC(rng As Range) As String
Dim c As Range
For Each c In rng
SumC = SumC & c
Next
End Function
-----------------

Sub sum()
Dim c As Range
For Each c In Range("E770:E790")
SumC = SumC & c
Next
ActiveCell.Value = SumC
End Sub

Thanks. It works

Another question
I want to select range with mouse instead of ("E770:E790")


You can use "selection" instead of "E770:E790"


Sub sum()
Dim c As Range
For Each c In Range("Selection")
SumC = SumC & c
Next
Range("E740").Activate
ActiveCell.Value = SumC
End Sub

select cell with mouse and start:
Run-time error '1004'
Method 'Range' of object '_Global' failed
debug in line For Each c In Range("Selection")

with
For Each c In Range(Selection)
same result

Claus Busch

sum character
 
Hi,

Am Thu, 13 Dec 2012 11:18:42 +0100 schrieb Bing:

For Each c In Range("Selection")


change it to:
For Each c In Selection


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

bing

sum character
 
change it to:
For Each c In Selection

Thanks. It works



All times are GMT +1. The time now is 02:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com