Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default moving a "count" range

I'm creating a macro where my count() range changes by 1 everyday. For
example, on day 1, my count range would be =count(a1:a30). On day 2 my range
would be =count(a2:a31), day 3 would be (a3:a32) and so on. So far I think
it may look something like:

Range("J20").Select
ActiveCell.FormulaR1C1 = "=COUNT(R[9]C[2]:R[13]C[2])"
Range("J21").Select

only much better, with a +1 in there somewhere...

Any ideas?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default moving a "count" range

Try this out:

Sub ColJFormula()
Range("J30").FormulaR1C1 = "=COUNT(R[-29]C[-9]:RC[-9])"
Range("J30").AutoFill Destination:=Range("J30:J50"), Type:=xlFillDefault
Range("J30").Select ' to see where formula starts
End Sub


HTH,
--
Data Hog


"sramsey" wrote:

I'm creating a macro where my count() range changes by 1 everyday. For
example, on day 1, my count range would be =count(a1:a30). On day 2 my range
would be =count(a2:a31), day 3 would be (a3:a32) and so on. So far I think
it may look something like:

Range("J20").Select
ActiveCell.FormulaR1C1 = "=COUNT(R[9]C[2]:R[13]C[2])"
Range("J21").Select

only much better, with a +1 in there somewhere...

Any ideas?

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
Create Pivot Table Data with Column "Sum" rather than "count" defa Johnny_99[_2_] Excel Discussion (Misc queries) 2 January 2nd 10 03:25 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM
Range("Weekending").Cells.Columns.Count Carl Brehm Excel Programming 4 February 16th 05 11:20 AM
Moving between "row" and "range" formats in VBA kls[_2_] Excel Programming 1 September 11th 04 10:44 PM


All times are GMT +1. The time now is 07:45 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"