Adjacent Cell Conditional Format Problem
Closed
malibu06
Posts
1
Registration date
Friday May 21, 2010
Status
Member
Last seen
May 21, 2010
-
May 21, 2010 at 04:54 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 22, 2010 at 03:19 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 22, 2010 at 03:19 AM
Related:
- Adjacent Cell Conditional Format Problem
- Format factory - Download - Other
- Kingston format utility - Download - Storage
- Excel date format dd.mm.yyyy - Guide
- Samsung format code - Guide
- Marksheet format in excel - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
May 22, 2010 at 03:19 AM
May 22, 2010 at 03:19 AM
try this. It will put (Blank) if starting from column 2, if the even column (2,4,6...) is not blank and next odd column (3, 5, 7) is blank
Sub FillInCell() Dim iMaxCols As Integer Dim iCol As Integer Dim lMaxRows As Long ActiveSheet.AutoFilterMode = False iMaxCols = Cells(1, Columns.Count).End(xlToLeft).Column Cells.Select Selection.AutoFilter For iCol = 2 To iMaxCols Step 2 Selection.AutoFilter Field:=iCol, Criteria1:="<>" Selection.AutoFilter Field:=iCol + 1, Criteria1:="" lMaxRows = Cells(Rows.Count, iCol).End(xlUp).Row If lMaxRows > 1 Then Range(Cells(2, iCol + 1), Cells(lMaxRows, iCol + 1)).Value = "(Blank)" End If Selection.AutoFilter Next iCol End Sub