Related:
- Macro, Range Selection
- Spell number in excel without macro - Guide
- Apple airtag range - Guide
- Macro excel download - Download - Spreadsheets
- Excel macro to create new sheet based on value in cells - Guide
- Screenshot excel selection - Guide
3 responses
This code will put a thin style border around the date, Column A and "FALSE", Column B.
I don't know what you want to do exactly, but this gives you an idea of how to select the cells with "FALSE".
Hope this helps!
Dim r
Dim intLastRow As Integer
Dim intRow As Integer
r = Range("A65536").End(xlUp).Row
intLastRow = r
For intRow = 1 To intLastRow
Rows(intRow).Select
If Cells(intRow, 2) = "FALSE" Then
Range(Cells(intRow, 1), Cells(intRow, 2)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
End If
Next intRow
Range("A1").Select
I don't know what you want to do exactly, but this gives you an idea of how to select the cells with "FALSE".
Hope this helps!
Dim r
Dim intLastRow As Integer
Dim intRow As Integer
r = Range("A65536").End(xlUp).Row
intLastRow = r
For intRow = 1 To intLastRow
Rows(intRow).Select
If Cells(intRow, 2) = "FALSE" Then
Range(Cells(intRow, 1), Cells(intRow, 2)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
End If
Next intRow
Range("A1").Select
Say that the column containing "True" or "False" is column B. You could create another adjacent column C with the following formula, say for row 1, =If(B1="False",1/0,1). Then fill this formula down. While the cells in Column C are highlighted, hit Edit > Goto > Special Cells > Errors. Then you can use the reference: Selection.Offset(0,-1).Select, and voila you have selected the cells that contain the word "False".