Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mallycat,
Can't thank you enough....your code got me on the right track for what I need to do...below is the final version that does what I want it to do...I need to do several different sorts of the data using the Named Range created below...Sorts and printouts will be activated by coded buttons calling this code up as required. As new names are entered/or deleted this code will pick them up, when called, and expand or contract the Named Range. Sub NamedRange() Dim F As Boolean x = 0 Do While F = False If Range("A1").Offset(x, 0).Value = "" Then F = True x = x - 1 End If x = x + 1 Loop ActiveWorkbook.Names.Add Name:="FirstQtr", RefersToR1C1:="=1stTOTALS!R3C1:R" & x & "C15" Range("FirstQtr").Select End Sub Can't thank you enough....was about ready to pull my hair out working on this. Have a great day...you just made mine...:) Don "Mallycat" wrote: Not sure exactly what you are doing, but this code will find the number or rows in your selection. Just change the first cell from A1 to what ever Sub findLast() Dim Found As Boolean Dim TotalRows as Integer x = 0 Do While Found = False If Range("a1").Offset(x, 0).Value = "" Then Found = True x = x - 1 End If x = x + 1 Loop TotalRows= x End Sub -- Mallycat ------------------------------------------------------------------------ Mallycat's Profile: http://www.excelforum.com/member.php...o&userid=35514 View this thread: http://www.excelforum.com/showthread...hreadid=557609 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
divide column(x) by column(y) to give column(x/y) in excel? | New Users to Excel | |||
Referencing date column A & time column B to get info from column | Excel Discussion (Misc queries) | |||
Return text in Column A if Column B and Column K match | Excel Worksheet Functions | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Discussion (Misc queries) | |||
Divide Column A by Column B multiply Column C | Excel Worksheet Functions |