VBA Help!

steveo0707

Board Regular
Joined
Mar 4, 2013
Messages
85
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
The following is the code I have written for my worksheet. I am getting the program to do everything except for the last Case Parameters. It's not putting the © in the F column nor shading the cell green. I have also already tried making it an If statement and that did not work either.

VBA Code:
Sub Scanning()
    Dim YELLOW As Variant
    Dim OFF_GREEN As Variant
    Dim GREEN As Variant
    Dim Row As Long
    ' DEFINE THE COLORS
    YELLOW = RGB(255, 255, 91)
    OFF_GREEN = RGB(196, 215, 155)
    GREEN = RGB(54, 248, 54)
    ' CYCLE THROUGH ROWS
    Row = 1 
          
    Do Until Range("E" & Row).Value = VBA.Constants.vbNullString
        ' CHECKING COLUMN E
        Select Case Range("E" & Row).Value
            Case "Working On"
                Range("A" & Row).Interior.Color = YELLOW
            Case "In Box"
                Range("A" & Row & ":B" & Row).Interior.Color = YELLOW
            Case "Crate Built"
                Range("F" & Row).Value = "©"
                Range("F" & Row).Interior.Color = GREEN
                
         End Select
        
               ' IF YOU ARE LOOKING FOR JUST A LETTER D IN COLUMN F
        If Range("F" & Row).Value = "D" Then Range("C" & Row).Interior.Color = OFF_GREEN
               
        Row = Row + 1
    Loop
End Sub
 
Still not getting anything on the Crate Built. I just don't get how it performs the first two cases but not the last one?
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
What are the answers to the questions in post #8 and #10?
 
Upvote 0
post#10 will not return return True it will return a number, whereas post#8 will return either true or false
 
Upvote 0
I just tried using #* and # 10 in different empty cells throughout the worksheet. I get True in some boxes and False in others. #10 I get 32 in some and #VALUE! in others.
 
Upvote 0
You need to point both the formula at a cell that has "Crate Built"
What do they both return?
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top