Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do you know what X is?
Assuming you know that value, then all you need is mySum = WorksheetFunction.SUM(Range("C4:C" & X) If you don't know, you could try cRows = Cells(Rows.Count,"C").End(xlUp).Row mySum = WorksheetFunction.SUM(Range("C4:C" & cRows) -- HTH RP (remove nothere from the email address if mailing direct) "Martin_Austin" wrote in message ... Hi everyone, this is my first post, so I wanted to start out saying "Hey there!" I'm 22, have done minor programming with HTML, PHP, etc, Access and Excel now being my interests, so I thought I'd get a question out of the way that has been bugging me for the better part of the day. What I have is a list of data in excel, going from A4:CX (x being variable, as it changes daily how long this list is). I want to write a macro that will count how many items are in that range, and then sum the items in C4:CX. I don't know how to let VBA know how many rows contain data, so that's where my trouble right now is coming from. If someone could step me in the right direction, I should be able to figure out the summing and counting from there. Thanks, and I'm glad to be here :o) -- Martin_Austin ------------------------------------------------------------------------ Martin_Austin's Profile: http://www.excelforum.com/member.php...o&userid=16382 View this thread: http://www.excelforum.com/showthread...hreadid=277559 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Summing (or counting) cells until there is a blank cell | Excel Discussion (Misc queries) | |||
Counting & Summing based on criteria on another column | Excel Discussion (Misc queries) | |||
Counting and Summing | Excel Discussion (Misc queries) |