Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Actually, I wasn't sure if the question had been completely answered, but
you you are probably right, this method is more than likely not what the OP wanted. However, I still think it is a valid question to develop code for... Where is the first completely blank row in a set of data? By the way, be sure to see my revised code and what it was that I revised... it will help you when studying the SpecialCells (which are linked to the UsedRange). Rick "TomPl" wrote in message ... Actually, I thought his question had already been answer, but I was bored. I have not used the SpecialCells function but it looks interesting. I think I will research it further, but that will have to wait until next week. Thanks Rick "Rick Rothstein (MVP - VB)" wrote: That is an interesting read on the OP's question. On the off-chance you are right, this function seems to work using less looping... Function FirstFullyEmptyRow() As Long Dim X As Long On Error Resume Next With Worksheets("Sheet1") For X = 1 To .UsedRange.Rows.Count Err.Clear If Rows(X).EntireRow.SpecialCells(xlCellTypeBlanks).C ount = _ .UsedRange.Columns.Count Then If Err.Number = 0 Then Exit For Next FirstFullyEmptyRow = X End With End Function Rick "TomPl" wrote in message ... Now I am thinking that "empty row" means all cells in that row (within the specified range) must be blank. You might be able to tell that I was bored today, because I did this: Sub EmptyRow() Dim ctr As Long Dim ctc As Long Dim eCells As Long Dim rng As Range 'Pick a range, any range, usedRange if you like. Set rng = ActiveSheet.Range("myRange") For ctr = 1 To UBound(rng.Value) eCells = 0 For ctc = 1 To UBound(rng.Value2) If IsEmpty(rng.Cells(ctr, ctc)) = False Then eCells = eCells + 1 End If Next ctc If eCells = 0 Then GoTo IsEmpty End If Next ctr ctr = ctr - 1 IsEmpty: MsgBox ("Empty Row Is Row " & ctr) End Sub "kleysonr" wrote: How can i get the number of the first empty row in a column ? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete Rows with Empty Cells with empty column 1 | Excel Programming | |||
Finding next empty empty cell in a range of columns | Excel Programming | |||
Excel - Autom. Filter "Empty / Non Empty cells" should come first | Excel Discussion (Misc queries) | |||
How can I convert empty strings to empty cells? | Excel Discussion (Misc queries) | |||
Can blank cells created using empty Double-Quotes not be empty?? | Excel Programming |