Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default If statement in macro to find blank cell/value in another cell

Trying to find a macro that will allow me to find a blank cell in a column,
and if the corresponding cell is populated, then tag that cell with a certain
value.
So, if Column AG is empty, but Column AM is not, then put an * in column AG,
then loop it to look in other columns as well.
So
if AG = blank, but AM is not blank, then place * in AG,
if AN = blank, but AT is not blank, then place * in AN,
if AU = blank, but BA is not blank, then place * in AU,
if BB = blank, but BH is not blank, then place * in BB,
etc.... For a total of 15 segments
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default If statement in macro to find blank cell/value in another cell

On 9 mrt, 16:14, Kennedy wrote:
Trying to find a macro that will allow me to find a blank cell in a column,
and if the corresponding cell is populated, then tag that cell with a certain
value.
So, if Column AG is empty, but Column AM is not, then put an * in column AG,
then loop it to look in other columns as well.
So
if AG = blank, but AM is not blank, then place * in AG,
if AN = blank, but AT is not blank, then place * in AN,
if AU = blank, but BA is not blank, then place * in AU,
if BB = blank, but BH is not blank, then place * in BB,
etc.... For a total of 15 segments


Hi Kennedy,

I tried this and looks to work fine on the current row only.

Sub SegmentMarker()

Dim iL As Integer
Dim iC1 As Integer
Dim iC2 As Integer
Dim iR As Integer

iR = ActiveCell.Row
iC1 = 33
iC2 = 39
For iL = 1 To 15
If IsEmpty(Cells(iR, iC1)) Then
If Not IsEmpty(Cells(iR, iC2)) Then
Cells(iR, iC1) = "'*"
End If
End If
iC1 = iC1 + 7
iC2 = iC2 + 7
Next
End Sub


HTH,

Wouter
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
macro to find the last blank cell in col. A peyman Excel Discussion (Misc queries) 16 September 17th 07 11:10 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 next blank cell via macro Eric Anderson Excel Programming 2 October 13th 06 08:53 PM
Return blank cell if 'find' statement not true Kanga 85 Excel Worksheet Functions 4 May 28th 06 04:25 PM
Macro to find blank cell Cutter[_9_] Excel Programming 2 July 6th 04 03:44 PM


All times are GMT +1. The time now is 09:18 PM.

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"