Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Dynamic formula for changing row numbers


In the formula below, R8 sometimes needs to be R6, sometimes R10, sometimes
R3, and so on.

It can be derived from the COUNTA of cells v1:v20 .

Tried doing a variable called myChngRow and tying it into the formula below,
but kept getting errors.

If anyone has the solution it would be sincerely appreciated.
Thank you in advance.
Regards,
- Mike


Selection.FormulaR1C1 = "=-SUMIFS(R8C26:R201C26,R8C19:R201C19,RC[-7])"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Dynamic formula for changing row numbers

Dim myCountA as long

mycounta = application.counta(activesheet.range("v1:v20")

selection.formular1c1 _
= "=-SUMIFS(R" & mycounta & "C26:R201C26,R" & mycounta & "C19:R201C19,RC[-7])"



MikeF wrote:

In the formula below, R8 sometimes needs to be R6, sometimes R10, sometimes
R3, and so on.

It can be derived from the COUNTA of cells v1:v20 .

Tried doing a variable called myChngRow and tying it into the formula below,
but kept getting errors.

If anyone has the solution it would be sincerely appreciated.
Thank you in advance.
Regards,
- Mike

Selection.FormulaR1C1 = "=-SUMIFS(R8C26:R201C26,R8C19:R201C19,RC[-7])"


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Dynamic formula for changing row numbers

I dropped a closing paren on this line:
mycounta = application.counta(activesheet.range("v1:v20")) '<-- added final )



Dave Peterson wrote:

Dim myCountA as long

mycounta = application.counta(activesheet.range("v1:v20")

selection.formular1c1 _
= "=-SUMIFS(R" & mycounta & "C26:R201C26,R" & mycounta & "C19:R201C19,RC[-7])"

MikeF wrote:

In the formula below, R8 sometimes needs to be R6, sometimes R10, sometimes
R3, and so on.

It can be derived from the COUNTA of cells v1:v20 .

Tried doing a variable called myChngRow and tying it into the formula below,
but kept getting errors.

If anyone has the solution it would be sincerely appreciated.
Thank you in advance.
Regards,
- Mike

Selection.FormulaR1C1 = "=-SUMIFS(R8C26:R201C26,R8C19:R201C19,RC[-7])"


--

Dave Peterson


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Dynamic formula for changing row numbers


Dave, that's EXACTLY what I was looking for.
Your tweak made it happen.

Thanx again!!!
- Mike

"Dave Peterson" wrote:

I dropped a closing paren on this line:
mycounta = application.counta(activesheet.range("v1:v20")) '<-- added final )



Dave Peterson wrote:

Dim myCountA as long

mycounta = application.counta(activesheet.range("v1:v20")

selection.formular1c1 _
= "=-SUMIFS(R" & mycounta & "C26:R201C26,R" & mycounta & "C19:R201C19,RC[-7])"

MikeF wrote:

In the formula below, R8 sometimes needs to be R6, sometimes R10, sometimes
R3, and so on.

It can be derived from the COUNTA of cells v1:v20 .

Tried doing a variable called myChngRow and tying it into the formula below,
but kept getting errors.

If anyone has the solution it would be sincerely appreciated.
Thank you in advance.
Regards,
- Mike

Selection.FormulaR1C1 = "=-SUMIFS(R8C26:R201C26,R8C19:R201C19,RC[-7])"


--

Dave Peterson


--

Dave Peterson

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
Help with copying dynamic column selected based on remote cell value and dynamic formula fill ers Charts and Charting in Excel 0 March 1st 06 01:05 AM
Help with copying dynamic column selected based on remote cell value and dynamic formula fill ers Excel Programming 0 March 1st 06 01:05 AM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Way To Copy Formula In Column Without Changing All Cell Numbers travelersway Excel Discussion (Misc queries) 2 September 3rd 05 08:36 PM
Putting numbers in excel without it changing into a formula? RachaelDPT Excel Worksheet Functions 3 April 22nd 05 10:12 AM


All times are GMT +1. The time now is 03:01 PM.

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

About Us

"It's about Microsoft Excel"