Macro Help

B

bm8211520

Ok first I am new at this and I hope this is how I am supposed to d
this.


Ok I am trying to work with macros but have never used them before.

I need to create a macro that will put a value from one cell int
another.

Here is a little background on what I am doing....

I have created a spreadsheet for a football pool with the names of th
people in the boxes. I have two cells at the top for the current scor
so I can see who is currently winning the pool. The pool is paying eac
quarter, and so what I want is a way to put the current score in eac
quarters own cells and it will list the winner and keep that info an
then at the next quarter click another button and do the same.
already have a place for everything to go I just need to know how t
create a macro for the four buttons (one for each quarter) to tak
whatever score i have in the cells at the top and put them into th
corresponding cells below that will keep that info and when i click th
next button it will do the same except put it into the next quarter
section.

any help would be appreciated.

Thank
 
B

bm8211520

I guess i expected to get an answer quickly hmm might have to forge
it

people can email me with any suggestions if the know what i am needin
to do

bm8211520 AT yahoo DOT com

thank
 
B

Bob Phillips

You could use something like

Public Sub Test()
Const TOP_SCORE As String = "C2" '<=== cell to capture current top score
Const NEXT_SCORE As String = "D2" '<=== cell to capture current next top
score
Const TARGET_COLUMN As String = "M" '<=== column to store quarterly data
Dim iLastRow As Long

With ActiveSheet
iLastRow = .Cells(.Rows.Count, TARGET_COLUMN).End(xlUp).Row
If iLastRow > 1 Or .Cells(1, TARGET_COLUMN).Value <> "" Then
iLastRow = iLastRow + 1
End If
.Cells(iLastRow, TARGET_COLUMN).Value = _
.Range(TOP_SCORE).Value
.Cells(iLastRow, TARGET_COLUMN).Offset(0, 1).Value = _
.Range(NEXT_SCORE).Value
End With

End Sub

Tune it to suit.

--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top