LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro select next blank cell in a row

Hi, I'm trying to do a macro that will automaticly select the first blank
cell that will appear in a row, I have tried the following but it doesn't
select the cell but my message box will give me the right cell adress for the
empty cell.

Sub A()
Dim myCell As Range
Dim NextEmpty As Range

Set myCell = ActiveSheet.Range("c5")
Do
If myCell.Value = "" Then
Set NextEmpty = myCell
Exit Do
Else
Set myCell = myCell.Offset(0, 1)
End If
Loop

MsgBox NextEmpty.Address

End Sub



 
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
How can I select the first blank cell Valdemar[_2_] Excel Worksheet Functions 4 January 18th 10 12:04 PM
Is there a formula to select the last non-blank cell in a list BROCK8292 Excel Discussion (Misc queries) 10 March 25th 08 12:32 AM
How do I select & use contents of first non-blank cell in row? plf100 Excel Worksheet Functions 9 November 15th 05 12:16 PM
I want to select the first blank cell in column A Greegan Excel Worksheet Functions 7 March 13th 05 12:56 PM
Select blank cell Hodar Excel Programming 6 January 21st 04 02:18 PM


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