LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Using a macro to add a count and sum on a dynamic range

Hi all,
I am an macro / vba extreme newbie so please don't laugh. We receive a
comma delimited txt file and I am writing a macro to take care of a log of
the generic formatting issues we use on every file to get it ready for use.
As it stands right now I have a start date in column H and an end date in I
and the macro is already subtracting the two to give me a length in column J.
What I am trying to do is add a sum and a count after the last row in column
J. The problem is that every file will have a different number of records.

Following is the tail end section of my code, like I said earlier, I am very
new at this so please don't laugh. Thank you in advance for your help.

ActiveCell.FormulaR1C1 = "LOS"
Range("J6").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-2]"
Range("J6").Select
Selection.NumberFormat = "General"
Selection.Copy
lr = Cells(Rows.Count, "a").End(xlUp).Row
Range("j6:j" & lr).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

 
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
Dynamic Range in Excel that won't count formulas [email protected] Excel Discussion (Misc queries) 1 January 24th 08 10:47 PM
Count dynamic range S Davis Excel Worksheet Functions 6 February 26th 07 07:51 PM
Macro to add count forumla with dynamic range falloutx Excel Programming 2 June 13th 06 05:23 AM
Dynamic Named Range count Matt Jensen Excel Programming 5 December 14th 04 01:04 PM
count and sum of dynamic range ???? wraithlead[_2_] Excel Programming 2 July 9th 04 09:48 PM


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