#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 122
Default Recording a Macro??

This is my first time recording a Marco.
I would like to know if I have a formula that contains 10 cells
=SUM(U20:U29)/COUNTIF(U20:U29,"0") I would like the Macro to repeat the same
formula in the next set of cells =SUM(U53:U62)/COUNTIF(U53:U62,"0")
Is there a way to set up the macro to replicate the formula 24 cells down?
This way I could use the macro reproduce my formula? I have 550 people with
18 cells to complete going through 6 worksheets and I am doing each one by
hand.

--
Thank You In Advance
Glenn
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,549
Default Recording a Macro??

I think this is what you want? Select a cell, run the code.
The selected cell and the one 24 rows below will contain the two formulas...
'--
Sub AddThemUp()
Dim rng As Range
Set rng = ActiveCell
rng.Formula = "=SUM(U20:U29)/COUNTIF(U20:U29,""0"")"
rng.Offset(24, 0).Formula = "=SUM(U53:U62)/COUNTIF(U53:U62,""0"")"
Set rng = Nothing
End Sub
--
Jim Cone
Portland, Oregon USA



"Glenn"
wrote in message
This is my first time recording a Marco.
I would like to know if I have a formula that contains 10 cells
=SUM(U20:U29)/COUNTIF(U20:U29,"0") I would like the Macro to repeat the same
formula in the next set of cells =SUM(U53:U62)/COUNTIF(U53:U62,"0")
Is there a way to set up the macro to replicate the formula 24 cells down?
This way I could use the macro reproduce my formula? I have 550 people with
18 cells to complete going through 6 worksheets and I am doing each one by
hand.
--
Thank You In Advance
Glenn
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 857
Default Recording a Macro??

Hi,

You haven't made the question clear.

1. You could show us a sample of your data?
2. Do you only want this for two rows?
3. You want to copy the formula 24 rows down but I notice in you example
that the formula is adjusting by 34 rows. Is that intentional or a mistake?
That means that the formula gets an average for cells that are further and
further away from the formula as you copy it down?
4. The formula you are giving us will not return the average of a set of
data containing numbers less than zero. Is this intentional? Will the range
contain 0's or just blanks or both?

If you were trying to repeat the formula every 24 rows with the cell
references adjusting the same amount, you don't need a macro, it would take
you 5 seconds to do it manually.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Glenn" wrote:

This is my first time recording a Marco.
I would like to know if I have a formula that contains 10 cells
=SUM(U20:U29)/COUNTIF(U20:U29,"0") I would like the Macro to repeat the same
formula in the next set of cells =SUM(U53:U62)/COUNTIF(U53:U62,"0")
Is there a way to set up the macro to replicate the formula 24 cells down?
This way I could use the macro reproduce my formula? I have 550 people with
18 cells to complete going through 6 worksheets and I am doing each one by
hand.

--
Thank You In Advance
Glenn

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 122
Default Recording a Macro??

Hello Shane,

1) I do not know how to show you a sample of my data.
I would like to show you what I mean. I will do my best to explain what it
is. I have a workbook that contains 6 worksheets that will compile data from
2 week period each worksheet. Each worksheet has a set of input cells. The
cells that I described in the previous post are collecting cell that are
compiling the average from the input worksheet. There is a worksheet called
Averages this consists of a single cell that collects all the information
from the worksheet used for inputs and place in a average cell. This is where
the macro or any idea you might have to do this work easier would come in
handy. Each person has a block of averaging collecting cells that consists of
18 cells the first 6 cells are 6 weeks of Game Knowledge the next 6 cells
equaling 6 weeks are Game Pace and the final 6 cells equaling 6 weeks are
Customer Skills. What I am doing is using my formula to get the info from the
worksheet placing into a cell on the average sheet and then go the next
person for the same week only moving down to the next persons week which
begins 24 cells down. Does this help you understand what I am doing? if not I
would be happy to send you a smaller copy of the workbook so maybe that could
help you understand. I have being working on this for the past 6 months.
First the formulas and now writing the program. Any hlpe would be very
helpful.

--
Thank You
Glenn


"Shane Devenshire" wrote:

Hi,

You haven't made the question clear.

1. You could show us a sample of your data?
2. Do you only want this for two rows?
3. You want to copy the formula 24 rows down but I notice in you example
that the formula is adjusting by 34 rows. Is that intentional or a mistake?
That means that the formula gets an average for cells that are further and
further away from the formula as you copy it down?
4. The formula you are giving us will not return the average of a set of
data containing numbers less than zero. Is this intentional? Will the range
contain 0's or just blanks or both?

If you were trying to repeat the formula every 24 rows with the cell
references adjusting the same amount, you don't need a macro, it would take
you 5 seconds to do it manually.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Glenn" wrote:

This is my first time recording a Marco.
I would like to know if I have a formula that contains 10 cells
=SUM(U20:U29)/COUNTIF(U20:U29,"0") I would like the Macro to repeat the same
formula in the next set of cells =SUM(U53:U62)/COUNTIF(U53:U62,"0")
Is there a way to set up the macro to replicate the formula 24 cells down?
This way I could use the macro reproduce my formula? I have 550 people with
18 cells to complete going through 6 worksheets and I am doing each one by
hand.

--
Thank You In Advance
Glenn

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
Recording Macro carrera Excel Discussion (Misc queries) 2 March 14th 08 02:07 PM
recording macro [email protected] Excel Discussion (Misc queries) 1 February 21st 08 06:19 PM
Recording a Macro Sharon Excel Discussion (Misc queries) 5 March 22nd 07 01:40 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM


All times are GMT +1. The time now is 07:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"