How can i change this so my lastrow= is the lowest cell of A B or C?
Something like tis
Many Thanks![]()
lastRow = Range(""lowest row filled of" A:C" & Rows.Count).End(xlUp).Row
How can i change this so my lastrow= is the lowest cell of A B or C?
Something like tis
Many Thanks![]()
lastRow = Range(""lowest row filled of" A:C" & Rows.Count).End(xlUp).Row
Last edited by Directlinq; 06-19-2009 at 10:27 AM.
Please familiarise yourself with the rules before posting. You can find them here.
Have a look at.
There may be something in there at helps.HTML Code:
If not let me know.
Unfortunatly i have data in D onwards
How would i go about checking whether A B or C is higher?
Many Thanks
Wow excellent Thanks so much
Works great
Would This Do It.
![]()
Sub lastRow() Dim c As Object With Sheets("Sheet1").Range("A:C") Set c = .Find(What:="*", LookIn:=xlValues, Lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlPrevious) End With End Sub
Last edited by D_Rennie; 06-19-2009 at 10:26 AM.
Didnt see it was solved.
I done this as an example.
Im Stoked I could Help![]()
Sub LastRow() Dim A As Object Dim B As Object Dim C As Object ' Find Last Used Cell With Sheets("Sheet1").Range("A:A") Set A = .Find(What:="*", LookIn:=xlValues, Lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlPrevious) End With With Sheets("Sheet1").Range("B:B") Set B = .Find(What:="*", LookIn:=xlValues, Lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlPrevious) End With With Sheets("Sheet1").Range("C:C") Set C = .Find(What:="*", LookIn:=xlValues, Lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlPrevious) End With ' Selsec rows higher or less Than Using >< If A.Row > B.Row & C.Row Then Range("A1:A" & A.Row).Select Else If B.Row < A.Row & C.Row Then Range("B1:B" & B.Row).Select Else If C.Row > A.Row & B.Row Then Range("C1:C" & C.Row).Select End Sub
Last edited by D_Rennie; 06-19-2009 at 11:01 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks