Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How do I find the next blank cell in a range?

Hey there all -
I am sure that this is terribly simple, but it has eluded me thus far. I am
trying to figure out how to find the first blank cell in a range. I am
working on creating a time sheet, and I need to be able to find the first
blank cell in a specific range of cells. I have found information on finding
the first blank cell in a single column, but this will be a two column range
that I am working with. Any help would be greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default How do I find the next blank cell in a range?

I'm guessing that there's more to this story....

What do you ultimately want to do after you find the blank cell?

***********
Regards,
Ron

XL2002, WinXP


"EazyCure" wrote:

Hey there all -
I am sure that this is terribly simple, but it has eluded me thus far. I am
trying to figure out how to find the first blank cell in a range. I am
working on creating a time sheet, and I need to be able to find the first
blank cell in a specific range of cells. I have found information on finding
the first blank cell in a single column, but this will be a two column range
that I am working with. Any help would be greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How do I find the next blank cell in a range?

After finding the blank cell I am going to enter the current date and time.
In the end I am going to write a macro where with the click of a button the
current date and time will be entered into the first available cell, I just
got hung up trying to find the first available cell.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default How do I find the next blank cell in a range?

Say your range is A1:B9999

And both A9999 and B1 are the first blank cells in each column.

Which is the first blank cell in that range (A1:B9999)?

No matter what you respond, you may want to look at
..specialcells(xlcelltypeblanks).cells(1). The question is what to apply it to.

It's the equivalent of selecting a range and hitting
edit|goto|special|Blanks
and then using the first cell in that reduced range.

EazyCure wrote:

After finding the blank cell I am going to enter the current date and time.
In the end I am going to write a macro where with the click of a button the
current date and time will be entered into the first available cell, I just
got hung up trying to find the first available cell.


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How do I find the next blank cell in a range?

First blank would be B1. (Left to right, then top to bottom).


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 340
Default How do I find the next blank cell in a range?

With the range selected, choose EditFind [blank] to locate the next
blank cell.


On 11 Jun, 17:41, EazyCure wrote:
After finding the blank cell I am going to enter the current date and time.
In the end I am going to write a macro where with the click of a button the
current date and time will be entered into the first available cell, I just
got hung up trying to find the first available cell.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default How do I find the next blank cell in a range?

You can loop backwards through the columns:

Option Explicit
Sub testme01()

Dim FirstEmptyCell As Range
Dim wks As Worksheet
Dim myRng As Range
Dim iCol As Long

Set wks = Worksheets("sheet1")

With wks
Set myRng = .Range("a1:B20")
End With

With myRng
For iCol = .Columns.Count To 1 Step -1
Set FirstEmptyCell = Nothing
On Error Resume Next
Set FirstEmptyCell _
= .Columns(iCol).Cells.SpecialCells(xlCellTypeBlanks ).Cells(1)
On Error GoTo 0

If FirstEmptyCell Is Nothing Then
'keep looking
Else
Exit For
End If
Next iCol
End With

If FirstEmptyCell Is Nothing Then
MsgBox "No empty cells!"
Else
MsgBox FirstEmptyCell.Address
End If

End Sub

Be aware that .specialcells() only looks at the used range. I'm not sure if
that's a problem for you.


EazyCure wrote:

First blank would be B1. (Left to right, then top to bottom).


--

Dave Peterson
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
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Find 1st blank cell in column & sum to the same row in another col Sharon Excel Worksheet Functions 2 March 7th 07 03:00 AM
IF function which can find a blank cell owl37 Excel Worksheet Functions 5 October 19th 06 05:48 PM
find the first and last non blank cell in a row Allan from Melbourne Excel Discussion (Misc queries) 3 May 19th 06 01:12 PM
find the first blank cell in a range and return me it's position steve alcock Links and Linking in Excel 2 May 13th 05 09:03 AM


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