ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Text & Colour Hi-lite of "blank" cell (https://www.excelbanter.com/excel-programming/431358-text-colour-hi-lite-blank-cell.html)

BEEJAY

Text & Colour Hi-lite of "blank" cell
 
Looking to insert Text and colour (45 orange) cell, when blank, under the
following conditions. This must be done in VBA.

If B? = "*" AND D? = unlocked and D? is " " (blank), then
colour D? Orange and insert "REQ'D"
ALSO:
If B? = "*" AND E? = unlocked and E? is " " (blank), then
colour E? Orange and insert "REQ'D"
I presume these two lines could be "joined" somehow, in the code.
As I picture it, this will be step # 1.

By way of explanation , Step # 2 will be to count all the cells that have
"REQ'D" in it, and display the total in a message.
"You have ____ (QTY) of items that require data input.
Do you wish to continue?"
"If NO, please go back and review missing data.
"If YES, Outstanding data rows will be copied to sheet "Outstanding"

Thanks in advance................

JLGWhiz[_2_]

Text & Colour Hi-lite of "blank" cell
 
A little crude but it works,

Sub citrus()
Dim lr As Long
lr = ActiveSheet.Cells(Rows.Count, 2).End(xlUp).Row
Set rng = ActiveSheet.Range("B2:B" & lr)
For Each c In rng
If c = "*" And Range("D" & c.Row) = "" And _
Range("D" & c.Row).Locked = False Then
c.Offset(0, 2).Interior.ColorIndex = 45
Range("D" & c.Row) = "REQ 'D"
End If
If c = "*" And Range("E" & c.Row) = "" And _
Range("E" & c.Row).Locked = False Then
c.Offset(0, 3).Interior.ColorIndex = 45
Range("E" & c.Row) = "REQ'D"
End If
Next
End Sub



"BEEJAY" wrote in message
...
Looking to insert Text and colour (45 orange) cell, when blank, under the
following conditions. This must be done in VBA.

If B? = "*" AND D? = unlocked and D? is " " (blank), then
colour D? Orange and insert "REQ'D"
ALSO:
If B? = "*" AND E? = unlocked and E? is " " (blank), then
colour E? Orange and insert "REQ'D"
I presume these two lines could be "joined" somehow, in the code.
As I picture it, this will be step # 1.

By way of explanation , Step # 2 will be to count all the cells that have
"REQ'D" in it, and display the total in a message.
"You have ____ (QTY) of items that require data input.
Do you wish to continue?"
"If NO, please go back and review missing data.
"If YES, Outstanding data rows will be copied to sheet "Outstanding"

Thanks in advance................





All times are GMT +1. The time now is 12:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com