# I need Excel macro help

I have a macro that I am trying to run in order to put formulas on groups of data.

The average formula that I use within the macro needs to use a varying range, I attempted to use Ctrl up in order to deal with the varying range. I found that when I then run the macro again it doesn't input the ctrl up it inputs how ever many cells it went up into the range so it then messes up the answer I get in the average cell because the range is always 13 as opposed to it changing depending on how much data there is.

Here is the VBA code for the Macro

Sub MOS_Formula()

'

' MOS_Formula Macro

'

'

[login to view URL](xlDown).Select

[login to view URL](xlDown).Select

[login to view URL]

[login to view URL](1, 0).Range("A1").Select

[login to view URL]

[login to view URL]("A1:K1").Select

[login to view URL] = True

[login to view URL](0, 3).Range("A1").Select

[login to view URL] = False

[login to view URL] = "=AVERAGE(R[-13]C:R[-1]C)"

[login to view URL](-1, 2).Range("A1").Select

[login to view URL]

[login to view URL](1, 0).Range("A1").Select

[login to view URL]

[login to view URL](0, 2).Range("A1").Select

[login to view URL] = False

[login to view URL] = False

[login to view URL] = "=RC[-2]/RC[-4]"

[login to view URL](0, 1).Range("A1").Select

[login to view URL] = False

[login to view URL] = "=(RC[-3]+RC[-2])/RC[-5]"

[login to view URL](1, 0).Range("A1").Select

[login to view URL](xlToLeft).Select

'

End Sub

This all works great except for the line that includes the average formula.

( 1 comentário ) Minneapolis, United States

ID do Projeto: #31519284

## Concedido a:

(312 Comentários)
7.1

## 14 freelancers estão ofertando em média \$32 nesse trabalho

(488 Comentários)
8.0
(482 Comentários)
7.4
(334 Comentários)
6.6
(137 Comentários)
6.1
VBAautomation

Hi, I hope you are doing well I am a professional on SQL server, VBA programming, MS access and also in power BI. I am doing this job since 2010.I can handle your project in a very prudent manner. Give me more details Mais

\$25 USD in 5 dias
(27 Comentários)
5.5
(29 Comentários)
5.2
(38 Comentários)
4.5
jojimathew571

Hi there, I checked the attached file and it appears that we can solve this quickly. I have a couple of questions to ask first. I am hoping for the opportunity to complete this project for you. Please feel free to con Mais

\$15 USD em 1 dia
(19 Comentários)
3.8

Hi I have read your project description. I am interested to work on this project. My priority target is customer satisfaction. I able to do this project for you easily and quickly, Knock me for more details. Thank you.

\$30 USD in 3 dias
(12 Comentários)
3.4
freelancer96500

Hi, I check your [login to view URL] is awesome work for me. I Have experience in Advance Excel with Dynamic Dashboard Using VBA, VBA Macros, Power Bi Visualization, DAX Function, Power Query, Power Pivot and knowledge Mais

\$25 USD em 1 dia
(2 Comentários)
1.4
hafizshoaibali

Hi, I understand you are looking for an Excel Specialist. I can do this job within 1 hour. I have more than 5+ years of tremendous experience in creating customized applications using Excel VBA. Thank you for taking Mais

\$10 USD em 1 dia
(1 Comentário)
0.9
atteeek

Hey, I hope you are doing well. I can assist you with your excel task, as I have advance Excel skills and I've been providing my services in this field for the last 5 years. I've extensive knowledge of Data Filters, D Mais

\$150 USD in 2 dias
(1 Comentário)
0.0
chelzia1323

I have completed [login to view URL] and I have data Entry Experience for 1 year. I will complete it Correctly and I will Do it in Alloted time.I will do it clearly and with Sincerity

\$20 USD in 7 dias
(0 Comentários)
0.0