Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Help in finding first empty cell in multiple ranges

I have a spreadsheet that I'm trying to set up that keeps tack of some sale
figures (all visible on one screen) in sets of 5 columms with each set
containing 4 cells on each row (Amt, Date, By, Note):
Set 1 (Colums A-D): Amt (Col A), Date (Col B), By (Col C), Note (Col D) for
each transaction. 27 items in rows 5 - 31
Set 2 (Column E-H): Amt (Col E), Date (Col F), By (Col G), Note (Col H) for
each transaction. 27 items in rows 5 - 31
Set 3 (Column I-L): Amt (Col I), Date (Col J), By (Col K), Note (Col L) for
each transaction. 27 items in rows 5 - 31
Set 4 (Column M-P): Amt (Col M), Date (Col N), By (Col O), Note (Col P) for
each transaction. 27 items in rows 5 - 31
Set 5 (Column Q-T): Amt (Col Q), Date (Col R), By (Col S), Note (Col T) for
each transaction. 27 items in rows 5 - 31

Now, what I want to do is to have Excel start by going down Colum A (for the
first group) (starting at Row 5) and find the first empty cell. If it
reaches the last cell in that column (A31) and it has data in it, I want it
to go to cell E5 (the start of the 2nd group of columns) and do the same
thing there... only stopping when it hits an empty cell. This would
continue through all 5 sets of data (if necessary) until it finds the first
empty cell in the Amt column.
Thanks for any help I can get.

Jonco


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Help in finding first empty cell in multiple ranges

Good Afternoon Jonco,
Here are two marco subs that get the same results. The only difference in
the two subs is, FindEmpty2() breaks range down into Areas ie each of your
section to search for the empty cells The other FindEmpty1(), treats the
search as on big range.. The results is still the same....

enjoy, Rick, FBKS, AK


Sub FindEmpty2()
Dim Srng As Range, Arng As Range
Dim FoundCell As Range
Dim ws As Worksheet

Set ws = ActiveSheet
Set Srng = ws.Range("A5:A32,E5:E32,I5:I32,M5:M32,Q5:Q32")

For Each Arng In Srng.Areas

Set FoundCell = Arng.Find(what:="", LookIn:=xlFormulas,
searchorder:=xlByRows)
If Not FoundCell Is Nothing Then
FoundCell.Select '' select empty cell
Exit Sub
End If
Next Arng

End Sub

================================================== ================
Sub FindEmpty1()
Dim Srng As Range
Dim FoundCell As Range
Dim ws As Worksheet

Set ws = ActiveSheet
Set Srng = ws.Range("A5:A32,E5:E32,I5:I32,M5:M32,Q5:Q32")

Set FoundCell = Srng.Find(what:="", LookIn:=xlFormulas,
searchorder:=xlByRows)
If Not FoundCell Is Nothing Then
FoundCell.Select '' select empty cell
Exit Sub
End If

End Sub



"jonco" wrote in message
. com...
I have a spreadsheet that I'm trying to set up that keeps tack of some

sale
figures (all visible on one screen) in sets of 5 columms with each set
containing 4 cells on each row (Amt, Date, By, Note):
Set 1 (Colums A-D): Amt (Col A), Date (Col B), By (Col C), Note (Col D)

for
each transaction. 27 items in rows 5 - 31
Set 2 (Column E-H): Amt (Col E), Date (Col F), By (Col G), Note (Col H)

for
each transaction. 27 items in rows 5 - 31
Set 3 (Column I-L): Amt (Col I), Date (Col J), By (Col K), Note (Col L)

for
each transaction. 27 items in rows 5 - 31
Set 4 (Column M-P): Amt (Col M), Date (Col N), By (Col O), Note (Col P)

for
each transaction. 27 items in rows 5 - 31
Set 5 (Column Q-T): Amt (Col Q), Date (Col R), By (Col S), Note (Col T)

for
each transaction. 27 items in rows 5 - 31

Now, what I want to do is to have Excel start by going down Colum A (for

the
first group) (starting at Row 5) and find the first empty cell. If it
reaches the last cell in that column (A31) and it has data in it, I want

it
to go to cell E5 (the start of the 2nd group of columns) and do the same
thing there... only stopping when it hits an empty cell. This would
continue through all 5 sets of data (if necessary) until it finds the

first
empty cell in the Amt column.
Thanks for any help I can get.

Jonco




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Help in finding first empty cell in multiple ranges

I'm not sure exactly how it works, but it does. Thank you very much.
Jonco


"Rick Hansen" wrote in message
...
Good Afternoon Jonco,
Here are two marco subs that get the same results. The only difference
in
the two subs is, FindEmpty2() breaks range down into Areas ie each of your
section to search for the empty cells The other FindEmpty1(), treats the
search as on big range.. The results is still the same....

enjoy, Rick, FBKS, AK


Sub FindEmpty2()
Dim Srng As Range, Arng As Range
Dim FoundCell As Range
Dim ws As Worksheet

Set ws = ActiveSheet
Set Srng = ws.Range("A5:A32,E5:E32,I5:I32,M5:M32,Q5:Q32")

For Each Arng In Srng.Areas

Set FoundCell = Arng.Find(what:="", LookIn:=xlFormulas,
searchorder:=xlByRows)
If Not FoundCell Is Nothing Then
FoundCell.Select '' select empty cell
Exit Sub
End If
Next Arng

End Sub

================================================== ================
Sub FindEmpty1()
Dim Srng As Range
Dim FoundCell As Range
Dim ws As Worksheet

Set ws = ActiveSheet
Set Srng = ws.Range("A5:A32,E5:E32,I5:I32,M5:M32,Q5:Q32")

Set FoundCell = Srng.Find(what:="", LookIn:=xlFormulas,
searchorder:=xlByRows)
If Not FoundCell Is Nothing Then
FoundCell.Select '' select empty cell
Exit Sub
End If

End Sub



"jonco" wrote in message
. com...
I have a spreadsheet that I'm trying to set up that keeps tack of some

sale
figures (all visible on one screen) in sets of 5 columms with each set
containing 4 cells on each row (Amt, Date, By, Note):
Set 1 (Colums A-D): Amt (Col A), Date (Col B), By (Col C), Note (Col D)

for
each transaction. 27 items in rows 5 - 31
Set 2 (Column E-H): Amt (Col E), Date (Col F), By (Col G), Note (Col H)

for
each transaction. 27 items in rows 5 - 31
Set 3 (Column I-L): Amt (Col I), Date (Col J), By (Col K), Note (Col L)

for
each transaction. 27 items in rows 5 - 31
Set 4 (Column M-P): Amt (Col M), Date (Col N), By (Col O), Note (Col P)

for
each transaction. 27 items in rows 5 - 31
Set 5 (Column Q-T): Amt (Col Q), Date (Col R), By (Col S), Note (Col T)

for
each transaction. 27 items in rows 5 - 31

Now, what I want to do is to have Excel start by going down Colum A (for

the
first group) (starting at Row 5) and find the first empty cell. If it
reaches the last cell in that column (A31) and it has data in it, I want

it
to go to cell E5 (the start of the 2nd group of columns) and do the same
thing there... only stopping when it hits an empty cell. This would
continue through all 5 sets of data (if necessary) until it finds the

first
empty cell in the Amt column.
Thanks for any help I can get.

Jonco






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
Finding empty cell in list Don Excel Programming 3 April 21st 06 11:53 PM
Finding next empty empty cell in a range of columns UncleBun Excel Programming 1 January 13th 06 11:22 PM
Finding next available empty cell in a row Wendy Excel Programming 3 January 13th 06 11:02 PM
Finding the first empty cell in a column Tegger Excel Programming 5 January 7th 06 12:12 AM
Finding the next empty cell. Unknown_User[_3_] Excel Programming 10 May 19th 04 02:45 PM


All times are GMT +1. The time now is 03:36 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"