ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro Help (https://www.excelbanter.com/excel-worksheet-functions/128717-macro-help.html)

bm8211520

Macro Help
 

Ok first I am new at this and I hope this is how I am supposed to do
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 into
another.

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

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

any help would be appreciated.

Thanks


--
bm8211520
------------------------------------------------------------------------
bm8211520's Profile: http://www.officehelp.in/member.php?userid=6307
View this thread: http://www.officehelp.in/showthread.php?t=1337463

Posted from - http://www.officehelp.in


bm8211520

Macro Help
 

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

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

bm8211520 AT yahoo DOT com

thanks


--
bm8211520
------------------------------------------------------------------------
bm8211520's Profile: http://www.officehelp.in/member.php?userid=6307
View this thread: http://www.officehelp.in/showthread.php?t=1337463

Posted from - http://www.officehelp.in


Bob Phillips

Macro Help
 
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)

"bm8211520" wrote in message
...

Ok first I am new at this and I hope this is how I am supposed to do
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 into
another.

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

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

any help would be appreciated.

Thanks


--
bm8211520
------------------------------------------------------------------------
bm8211520's Profile: http://www.officehelp.in/member.php?userid=6307
View this thread: http://www.officehelp.in/showthread.php?t=1337463

Posted from - http://www.officehelp.in





All times are GMT +1. The time now is 06:08 AM.

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