Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default finding next empty row from bottom up!!


hi, I need to find the next empty row in my data range, but it has
several empty rows throughout it.
I need to be able to measure from the bottom of a worksheet upwards, on
column B
and then select the next empty row

any ideas?


--
matpj
------------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=481003

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default finding next empty row from bottom up!!


Use this code:Sub lastrow()
Dim rRng As Range
Set rRng = Range("A1:A" & Range("A"
Rows.Count).End(xlUp).Row)
With rRng.Offset(rRng.Count, 0).Resize(1, 1).Select
End With
End Sub

places cursor in cell A99999 where 99999=the first row below the las
entry in column

--
swatsp0

-----------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...fo&userid=1510
View this thread: http://www.excelforum.com/showthread.php?threadid=48100

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default finding next empty row from bottom up!!


Use this code:Sub lastrow()
Dim rRng As Range
Set rRng = Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)
With rRng.Offset(rRng.Count, 0).Resize(1, 1).Select
End With
End Sub

places cursor in cell A99999 where 99999=the first row below the last
entry in column A


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=481003

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default finding next empty row from bottom up!!


Part of your solution will probably need this code:

Find the very last used cell in a Column:

Sub LastCellInColumn()

Range("A65536").End(xlup).Select

End Sub

Since you know "B" is the column with the last data, change the code to
read:

Range("B65536").End(x1up).Select

Perhaps one of the more experienced members of this group can show us
how to use this...


--
Campbellj4
------------------------------------------------------------------------
Campbellj4's Profile: http://www.excelforum.com/member.php...o&userid=28506
View this thread: http://www.excelforum.com/showthread...hreadid=481003

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default finding next empty row from bottom up!!


Part of your solution will probably need this code:

Find the very last used cell in a Column:

Sub LastCellInColumn()

Range("A65536").End(xlup).Select

End Sub

Since you know "B" is the column with the last data, change the code to
read:

Range("B65536").End(x1up).Select

Perhaps one of the more experienced members of this group can show us
how to use this...


--
Campbellj4
------------------------------------------------------------------------
Campbellj4's Profile: http://www.excelforum.com/member.php...o&userid=28506
View this thread: http://www.excelforum.com/showthread...hreadid=481003



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default finding next empty row from bottom up!!


swatsp0p Wrote:
Use this code:Sub lastrow()
Dim rRng As Range
Set rRng = Range("A1:A" & Range("A"
Rows.Count).End(xlUp).Row)
With rRng.Offset(rRng.Count, 0).Resize(1, 1).Select
End With
End Sub

places cursor in cell A99999 where 99999=the first row below the las
entry in column A


Of course for Column B, simply change the reference in the above cod
from 'A' to 'B' each place it occurs.

Also, I forgot to mention that if you want to skip 1 or more rows belo
the last entry, adjust the "Offset(rRng.Count, 0)" by changing the zer
to as many rows as you want to skip. e.g to leave 2 blank rows, chang
the zero to a 2. If the last active row was 100, the cursor would b
placed in 103 (skipping 101 & 102).

You can assign this code to a button or simply run it by pressin
Alt+F8 and selecting "lastrow" from the list.

Does this work for you

--
swatsp0

-----------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...fo&userid=1510
View this thread: http://www.excelforum.com/showthread.php?threadid=48100

Reply
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
What produces empty rows at the bottom of a spreadsheet? scottdac Excel Discussion (Misc queries) 2 May 3rd 07 08:01 PM
unwanted empty rows at worksheet bottom Joe Miller Excel Discussion (Misc queries) 1 August 13th 06 07:46 PM
finding next empty row from bottom up!! matpj[_5_] Excel Programming 0 November 2nd 05 04:11 PM
Finding Bottom of Sheet LizzyBorden1369 Excel Worksheet Functions 2 July 1st 05 08:37 PM
empty rows at bottom of worksheet michael g Excel Discussion (Misc queries) 2 January 18th 05 09:17 PM


All times are GMT +1. The time now is 02:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"