A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Discussion (Misc queries)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

macro to look for empty cell



 
 
Thread Tools Display Modes
  #1  
Old April 14th 05, 08:48 AM
esrei
external usenet poster
 
Posts: n/a
Default macro to look for empty cell

What is the code for a makro to look for the first empty
cell in column A?
Ads
  #2  
Old April 14th 05, 11:57 AM
John Mansfield
external usenet poster
 
Posts: n/a
Default

This code will color the first empty cell in the range A1:A10 yellow. When
the empty cell is found, the routine exits.

Sub FlagFirstEmpty()
Dim Rng As Range
For Each Rng In Range("A1:A10")
If IsEmpty(Rng) = True Then
Rng.Interior.ColorIndex = 6
Exit Sub
End If
Next
End Sub

----
Regards,
John Mansfield
http://www.pdbook.com

"esrei" wrote:

> What is the code for a makro to look for the first empty
> cell in column A?
>

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I start a macro from a cell by using a formula PraxisPete Excel Worksheet Functions 1 April 8th 05 08:57 AM
Syntax for inferred cell references donesquire Excel Worksheet Functions 4 April 4th 05 09:29 PM
A Macro that will cut and paste to specific cell VBA12thRoundDraftPick Excel Discussion (Misc queries) 1 March 31st 05 06:11 AM
show macro security setting in a cell Mark Excel Worksheet Functions 3 March 21st 05 07:53 AM
Macro - - Automation Jac Excel Discussion (Misc queries) 8 December 27th 04 02:42 PM


All times are GMT +1. The time now is 12:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.