LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Find first blank cell

Thanks Dave. I had to modify it to fit my needs, but you gave me the concept
I needed.
--
Jim T


"Dave Peterson" wrote:

Option Explicit
Sub testme()

Dim FirstEmpty As Range
Dim StartCell As Range

With ActiveSheet
Set StartCell = .Range("A3")
If IsEmpty(StartCell.Value) Then
Set FirstEmpty = StartCell
ElseIf IsEmpty(StartCell.Offset(0, 1).Value) Then
Set FirstEmpty = StartCell.Offset(0, 1)
Else
Set FirstEmpty = StartCell.End(xlToRight).Offset(0, 1)
End If
End With

MsgBox StartCell.Address(0, 0) & vbLf & FirstEmpty.Address(0, 0)

End Sub

Jim Tibbetts wrote:

Cell A3 has data in it. How do I go to the first empty cell to the right so I
can paste data? I have this code and it works if there is data in cell B3,
but doesn't work if B3 is blank.

Range("A3").End(xlToRight).Offset(0, 1).Select

Thanks for any help,
--
Jim T


--

Dave Peterson

 
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 the first blank row in a cell Chris Anderson Excel Discussion (Misc queries) 6 November 7th 08 04:08 PM
Start Cell B1 then find first blank cell, insert subtotal, next non blank, then next blank, sutotal cells in between......... [email protected][_2_] Excel Programming 2 June 7th 07 09:27 PM
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 first blank cell Rui Excel Programming 5 November 20th 04 02:31 PM
Find and blank cell then Do this..... Bonnie[_5_] Excel Programming 6 November 11th 03 04:35 PM


All times are GMT +1. The time now is 06:05 PM.

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"