LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
Don Don is offline
external usenet poster
 
Posts: 487
Default Last Row In Column..

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
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
divide column(x) by column(y) to give column(x/y) in excel? James New Users to Excel 2 April 24th 23 11:46 AM
Referencing date column A & time column B to get info from column TVGuy29 Excel Discussion (Misc queries) 1 January 24th 08 09:50 PM
Return text in Column A if Column B and Column K match jeannie v Excel Worksheet Functions 4 December 13th 07 07:36 PM
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 [email protected] Excel Discussion (Misc queries) 1 December 27th 06 05:47 PM
Divide Column A by Column B multiply Column C Stumped Excel Worksheet Functions 3 December 28th 05 05:51 AM


All times are GMT +1. The time now is 09:23 AM.

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"