View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
mobilenetmomma mobilenetmomma is offline
external usenet poster
 
Posts: 7
Default how to do number additions in a spread sheet faster

Thank you, thank you thank you!!! I shall work on this tonight and let you
know how all turns out, I am sure if I can follow your instructions correctly
that you have made my whole life easier!!!!

--
Thanks, Mobilenetmomma the eternal student


"Rick Rothstein (MVP - VB)" wrote:

Use this code instead of what I posted earlier... it has some range checking
in it so that you can't accidentally put an entry outside of the grid of
data.

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _
Cancel As Boolean)
Dim Answer As Variant
Dim LastRow As Long
Dim LastCol As Long
LastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
LastCol = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
With Target
If .Column = 1 And .Row 1 And .Row <= LastRow Then
Cancel = True
Do
Answer = InputBox("How many students?", "Specify Number Of
Students")
If Answer = "" Then
Exit Do
ElseIf Answer 0 And Answer <= LastCol - 1 Then
.Offset(0, Answer).Value = .Offset(0, Answer).Value + 1
Exit Do
End If
Loop
End If
End With
End Sub

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
Wow... did I ever have the wrong mental picture of your layout! Thanks for
clarifying it for me. Okay, give this a try. On the sheet where your data
is, right-click the sheet name tab at the bottom of the sheet and click on
View Code on the popup menu that appears. This will take you into the VBA
editor and place your cursor in a code window. Copy/Paste this code

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _
Cancel As Boolean)
Dim Answer As Long
If Target.Column = 1 Then
Cancel = True
Answer = InputBox("How many students?", "Specify Number Of Students")
Target.Offset(0, Answer).Value = Target.Offset(0, Answer).Value + 1
End If
End Sub

into that code window. That's it. Go back to your worksheet and
right-click on one of the astrological aspects in Column A. You will be
presented with an InputBox asking you how many students. Type in your
number, hit the enter key (or click the OK button, your choice) and it
will add one more to that column's cell for the row of the astrological
aspect you right-clicked on.

Rick


"mobilenetmomma" wrote in
message ...
Thank you Rick for being so patient with me :0)
Lets see if I can get it right this time.....
I am picturing a spread sheet and right now I have along the left column
the
list of different astrological aspects under Column A lets say "Mars
square
the Sun" is the first one.

Then starting with Column B all the way through to EG I have beneath each
of
these letters the numbers 1 thru 156 respectively

How I am doing it now is the old fashioned way, if I have 10 students in
one
of the classrooms on the day "Mars is square the Sun" then I tab over to
the
Column K which is the column that has the "10" beneath it and add
another
"one" to whatever number is there from before. If also there are 35
students in another classroom I would tab over to Column AJ where the 35
is
located and I go through this routine 10 times for each of the aspects,
even
to the point when someone gets up to leave I note the time and the aspect
and
then add that number under the column that corresponds to the number in
the
class at that time.

I want to be able to somehow make it that I don't need to tab through
sometimes all of the numbers to get to the column that I want. I want to
be
able to have 10 cells that I can just tab through and when I enter the
number, then the program will realize that I am wanting to "add one more
" to
the previous total. So when I have ten students and I type in the number
10
in whatever cell, it will "add one more" to the total that is existing in
the
column that houses the number "10" which is in this instance Column "K".

I truly appreciate your slugging through this with me....and I am sorry
that
I am being so dense.....I hope this helps you help me :0)
--
Thanks, Mobilenetmomma the eternal student


"Rick Rothstein (MVP - VB)" wrote:

I think you are still missing the point of my question. When you say "I
need
ten columns"... my question is not that there are 10 of them, but which
10
are they. In your first post, you said "I simply type in the numbers I
need
in each column and then the numbers are "magically" added to the correct
number columns". My question is... what are the number of these 10
"correct
columns"? And, once you tell me the column numbers where you want your
numbers to finally be placed at, I also want to know if these 10
"correct
column" numbers are **always** going to be the same 10 column numbers.
I'm
not asking for a the one or two columns you might fill in the first day,
and
the one or two the next day... what I want to know is **all** the
"correct
column" numbers that will ever be filled in by you as explained in your
first message.

I don't think this will be hard to do; but first we must understand your
setup and how you want/need to interact with it. When answering our
questions, keep in mind we know absolutely nothing about your
worksheet...
specifically, we don't know how it is laid out... so you have to tell
us...
don't make us guess (because we will probably guess wrong<g).

Rick


"mobilenetmomma" wrote in
message
...
Hi Rick,
I guess I am being really dense, and I apologize. I need ten columns
and
each of those ten columns should be able to accept upto the numbers
156 so
that lets say I needed to put a 16 in the first column on one day but
then
on
the next day I need to put a 95 and perhaps the third day I need to
put a
1
in that same column. I will need 10 colums that will allow me to
enter
varying numbers in each of the columns and there might be instances
when
in
the first column I will have the same number as perhaps the fourth
column
and
also the tenth column.

I am beginning to believe that this is not as simple as I thought it
might
be. Thanks for all of your help!
--
Thanks, Mobilenetmomma the eternal student


"Rick Rothstein (MVP - VB)" wrote:

But are the column numbers your 10 pieces of data going in always the
same
10 columns (specifically, the 10 you mentioned in your first post)?

Rick


"mobilenetmomma" wrote in
message
...
Hi Rick
The number of cells will most probably stay at 10, but there is a
possibility that it will increase.
The column numbers will be chronological starting with 1 and
running
through
156. I want to have to only be concerned with filling in 10 cells
with
numbers that will "magically" find their ways to their respectively
numbered
column and add themselves to any other number that is there so that
I
will
have a running total in each cell in this "magic" land that I can
then
look
at and analyze. Thank you so much for your help!
--
Thanks, Mobilenetmomma the eternal student


"Rick Rothstein (MVP - VB)" wrote:

Are there always only 10 cells to fill in, or could this number
change
with
each set of cells to be filled in?

Are the column numbers to be filled in always 1,
45,67,99,345,678,and
987,
or can the column numbers vary with each set of cells to be filled
in?

Rick


"mobilenetmomma" wrote
in
message
...
I am doing research on numbers. I have been entering the numbers
in
a
very
time consuming and potentially error ridden manner....the old
fashioned
way
by scrolling through the colums and then when I come to the
column I
want
to
add a number to stopping at that column changing the number that
was
there
to
indicate another addition of that number then pressing enter and
then
on
to
the next number. THERE HAS TO BE A SIMPLER WAY, BUT I DON'T
KNOW
ENOUGH
TO
KNOW HOW TO DO IT!

Column A B C D E F............xx
December 1 2 3 4 5............22259

I am only entering in 10 numbers into each row under each
number
column,
but I have to scroll all the way accross until i get to each
number
column's
column . i.e. I could have to add #'s 1, 45,67,99,345,678,and
987
but I
need
to scroll from 1 to 45 then onto all the others. I want to be
able
to
have
my row look like this
Column A B C D E F G H I J K
December __ __ __ __ __ __ __ __ __ __
and then I simply type in the numbers I need in each column and
then
the
numbers are "magically" added to the correct number columns. I
hope
this
makes sense to someone and can help me.

--
Thanks, Mobilenetmomma the eternal student