#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Adding Problem

Hi all. Column A is a list of names. Column B is a number. Several more
columns of text. Column E is a number. I want to add Column E to B. Then I
want to print the sheet. Then I want to clear Column E, but keep the results
in Column B. I need to do this so that I can keep adding numbers to column B.

A B E
Joe Smith 80 4
Bob Brown 84 4

After adding, it looks like this:
Joe Smith 84
Bob Brown 88

Several days later, I want to add more numbers to Column B
Joe Smith 84 4
Bob Brown 88 3

After adding, it looks like this:
Joe Smith 88
Bob Brown 91

Can I do this? If so, please help, I'm at a loss.
Thanks in advance for any help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 834
Default Adding Problem

With Activesheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 T LastRow

If IsNumeric(.Cells(i, "B").Value2) Then

.Cells(i, "B").Value2 = .Cells(i, "B").Value2 + .Cells(i,
"C").Value2
End If
Next i

--

HTH

Bob

"RM270" wrote in message
...
Hi all. Column A is a list of names. Column B is a number. Several more
columns of text. Column E is a number. I want to add Column E to B. Then I
want to print the sheet. Then I want to clear Column E, but keep the
results
in Column B. I need to do this so that I can keep adding numbers to column
B.

A B E
Joe Smith 80 4
Bob Brown 84 4

After adding, it looks like this:
Joe Smith 84
Bob Brown 88

Several days later, I want to add more numbers to Column B
Joe Smith 84 4
Bob Brown 88 3

After adding, it looks like this:
Joe Smith 88
Bob Brown 91

Can I do this? If so, please help, I'm at a loss.
Thanks in advance for any help.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Adding Problem

Bob, I'm getting an error when I put the code in. It doesn't like the For i =
1 T last row. It is giving me a complie error. Says an expects a "to" Any
suggestions?
Thanks

"Bob Phillips" wrote:

With Activesheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 T LastRow

If IsNumeric(.Cells(i, "B").Value2) Then

.Cells(i, "B").Value2 = .Cells(i, "B").Value2 + .Cells(i,
"C").Value2
End If
Next i

--

HTH

Bob

"RM270" wrote in message
...
Hi all. Column A is a list of names. Column B is a number. Several more
columns of text. Column E is a number. I want to add Column E to B. Then I
want to print the sheet. Then I want to clear Column E, but keep the
results
in Column B. I need to do this so that I can keep adding numbers to column
B.

A B E
Joe Smith 80 4
Bob Brown 84 4

After adding, it looks like this:
Joe Smith 84
Bob Brown 88

Several days later, I want to add more numbers to Column B
Joe Smith 84 4
Bob Brown 88 3

After adding, it looks like this:
Joe Smith 88
Bob Brown 91

Can I do this? If so, please help, I'm at a loss.
Thanks in advance for any help.



.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Adding Problem

Bob, I'm getting an error when I put the code in. It doesn't like the For i=1
t Lastrow
It gives me a complie error, it is expecting a To statement. Any suggestions?

Also, my VBA is a little rusty. What exactly are you telling it to do?
Thanks


"Bob Phillips" wrote:

With Activesheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 T LastRow

If IsNumeric(.Cells(i, "B").Value2) Then

.Cells(i, "B").Value2 = .Cells(i, "B").Value2 + .Cells(i,
"C").Value2
End If
Next i

--

HTH

Bob

"RM270" wrote in message
...
Hi all. Column A is a list of names. Column B is a number. Several more
columns of text. Column E is a number. I want to add Column E to B. Then I
want to print the sheet. Then I want to clear Column E, but keep the
results
in Column B. I need to do this so that I can keep adding numbers to column
B.

A B E
Joe Smith 80 4
Bob Brown 84 4

After adding, it looks like this:
Joe Smith 84
Bob Brown 88

Several days later, I want to add more numbers to Column B
Joe Smith 84 4
Bob Brown 88 3

After adding, it looks like this:
Joe Smith 88
Bob Brown 91

Can I do this? If so, please help, I'm at a loss.
Thanks in advance for any help.



.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 834
Default Adding Problem

Sorry, I had a typo, and there was wrap-around which can give problems.

Try this

With Activesheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To LastRow

If IsNumeric(.Cells(i, "B").Value2) Then

.Cells(i, "B").Value2 = .Cells(i, "B").Value2 _
+ .Cells(i, "C").Value2
.Cells(i, "C").Value2 = ""
End If
Next i
End With

All it does it loop through every row and add B & C up

--

HTH

Bob

"RM270" wrote in message
...
Bob, I'm getting an error when I put the code in. It doesn't like the For
i=1
t Lastrow
It gives me a complie error, it is expecting a To statement. Any
suggestions?

Also, my VBA is a little rusty. What exactly are you telling it to do?
Thanks


"Bob Phillips" wrote:

With Activesheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 T LastRow

If IsNumeric(.Cells(i, "B").Value2) Then

.Cells(i, "B").Value2 = .Cells(i, "B").Value2 + .Cells(i,
"C").Value2
End If
Next i

--

HTH

Bob

"RM270" wrote in message
...
Hi all. Column A is a list of names. Column B is a number. Several
more
columns of text. Column E is a number. I want to add Column E to B.
Then I
want to print the sheet. Then I want to clear Column E, but keep the
results
in Column B. I need to do this so that I can keep adding numbers to
column
B.

A B E
Joe Smith 80 4
Bob Brown 84 4

After adding, it looks like this:
Joe Smith 84
Bob Brown 88

Several days later, I want to add more numbers to Column B
Joe Smith 84 4
Bob Brown 88 3

After adding, it looks like this:
Joe Smith 88
Bob Brown 91

Can I do this? If so, please help, I'm at a loss.
Thanks in advance for any help.



.



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Adding Problem

Bob, you are the best! Thanks bunches. It does exactly what I want it to do!

"Bob Phillips" wrote:

Sorry, I had a typo, and there was wrap-around which can give problems.

Try this

With Activesheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To LastRow

If IsNumeric(.Cells(i, "B").Value2) Then

.Cells(i, "B").Value2 = .Cells(i, "B").Value2 _
+ .Cells(i, "C").Value2
.Cells(i, "C").Value2 = ""
End If
Next i
End With

All it does it loop through every row and add B & C up

--

HTH

Bob

"RM270" wrote in message
...
Bob, I'm getting an error when I put the code in. It doesn't like the For
i=1
t Lastrow
It gives me a complie error, it is expecting a To statement. Any
suggestions?

Also, my VBA is a little rusty. What exactly are you telling it to do?
Thanks


"Bob Phillips" wrote:

With Activesheet

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 T LastRow

If IsNumeric(.Cells(i, "B").Value2) Then

.Cells(i, "B").Value2 = .Cells(i, "B").Value2 + .Cells(i,
"C").Value2
End If
Next i

--

HTH

Bob

"RM270" wrote in message
...
Hi all. Column A is a list of names. Column B is a number. Several
more
columns of text. Column E is a number. I want to add Column E to B.
Then I
want to print the sheet. Then I want to clear Column E, but keep the
results
in Column B. I need to do this so that I can keep adding numbers to
column
B.

A B E
Joe Smith 80 4
Bob Brown 84 4

After adding, it looks like this:
Joe Smith 84
Bob Brown 88

Several days later, I want to add more numbers to Column B
Joe Smith 84 4
Bob Brown 88 3

After adding, it looks like this:
Joe Smith 88
Bob Brown 91

Can I do this? If so, please help, I'm at a loss.
Thanks in advance for any help.


.



.

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
#Adding new worksheet problem Sandeep Lohchab Excel Discussion (Misc queries) 2 January 14th 10 03:26 PM
Adding problem in excel EggMan903 Excel Worksheet Functions 6 May 26th 09 10:32 PM
Adding problem Japhy Excel Discussion (Misc queries) 2 November 4th 06 11:56 AM
Problem adding a worksheet farmkid21 Excel Worksheet Functions 1 March 6th 06 01:08 AM
problem adding rvnwdr Excel Discussion (Misc queries) 2 June 8th 05 06:36 PM


All times are GMT +1. The time now is 02:50 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"