| CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 01:07:20 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=0485907607c8469d163955c3eb2c2196a1d01ee0a1bce123f50c927bf114722da%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%229M5hSmpDLOP1FoMyYS5cyuoaM2LLNb8k%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d2b31f19e11f95-BLR
VBA - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub ApplyCustomFormatting()
- Dim ws As Worksheet
- Set ws = ThisWorkbook.Sheets("Design") ' Change as needed
- Dim lastRow As Long
- lastRow = ws.Cells(ws.Rows.Count, "Y").End(xlUp).Row
- Dim i As Long
- Dim cell As Range
- Dim fCrosshatch As String, fRed As String, fYellow As String, fGreen As String
- For i = 14 To 300 ' Adjust start row as needed
- Select Case ws.Cells(i, "Y").Value
- Case "Checkbox", "Dropdown", "Input"
- Set cell = ws.Cells(i, "Z")
- cell.Style = "Normal Entry"
- ' Data Validation
- With cell.Validation
- Select Case ws.Cells(i, "Y").Value
- Case "Checkbox"
- .Delete
- .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
- Operator:=xlBetween, Formula1:="=TorF"
- .IgnoreBlank = True
- .InCellDropdown = False
- .InputMessage = "Use Checkbox"
- .ErrorMessage = "Use Checkbox"
- .ShowInput = True
- .ShowError = True
- cell.Style = "Normal Entry Checkbox"
- Case "Dropdown"
- .Delete
- .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
- Operator:=xlBetween, Formula1:="=INDIRECT(X" & i & ")"
- .IgnoreBlank = True
- .InCellDropdown = True
- .ErrorMessage = "Please use the dropdown"
- .ShowError = True
- End Select
- End With
- ' Cell Style
- ' Clear existing formatting
- cell.FormatConditions.Delete
- ' Add left border without removing others
- With cell.Borders(xlEdgeLeft)
- .LineStyle = xlContinuous
- .Weight = xlThin
- .ColorIndex = xlAutomatic
- End With
- ' Shared conditions
- fCrosshatch = "=OR($V" & i & "=FALSE, AND($S" & i & "=FALSE, ReportType<>""Final""), AND($T" & i & "=FALSE, ReportType<>""Rough""))"
- fRed = "=OR($W" & i & "=TRUE, AND($Z" & i & "=TRUE, $V" & i & "=FALSE))"
- fYellow = "=AND($U" & i & ", NOT($Z" & i & "))"
- fGreen = "=$Z" & i & "=TRUE"
- Select Case ws.Cells(i, "Y").Value
- Case "Input"
- fGreen = "=LEN($Z" & i & ")>0"
- fRed = "=OR($W" & i & "=TRUE, AND(LEN(TRIM($Z" & i & "))>0, $V" & i & "=FALSE))"
- Case "Dropdown"
- fYellow = "=AND($U" & i & ", OR(LEN($Z" & i & ")=0, $Z" & i & "=""Not Met""))"
- fGreen = "=LEN($Z" & i & ")>0"
- fRed = "=OR($W" & i & "=TRUE, AND(LEN(TRIM($Z" & i & "))>0, $V" & i & "=FALSE))"
- End Select
- ' Apply Conditional Formatting
- ' 1. Crosshatch (NO stop if true)
- With cell.FormatConditions.Add(Type:=xlExpression, Formula1:=fCrosshatch)
- .Interior.Pattern = xlPatternChecker
- .Interior.PatternColorIndex = xlAutomatic
- .StopIfTrue = False
- End With
- ' 2. RED (shared across all types)
- With cell.FormatConditions.Add(Type:=xlExpression, Formula1:=fRed)
- if ws.Cells(i, "Y").Value = "Checkbox" Then
- .Font.Color = RGB(255, 0, 0)
- End If
- .Interior.Color = RGB(255, 0, 0)
- .StopIfTrue = True
- End With
- ' 3. YELLOW
- With cell.FormatConditions.Add(Type:=xlExpression, Formula1:=fYellow)
- if ws.Cells(i, "Y").Value = "Checkbox" Then
- .Font.Color = RGB(255, 255, 153)
- End If
- .Interior.Color = RGB(255, 255, 153)
- .StopIfTrue = True
- End With
- ' 4. GREEN
- With cell.FormatConditions.Add(Type:=xlExpression, Formula1:=fGreen)
- if ws.Cells(i, "Y").Value = "Checkbox" Then
- .Font.Color = RGB(146, 208, 80)
- End If
- .Interior.Color = RGB(146, 208, 80)
- .StopIfTrue = True
- End With
- End Select
- Next i
- MsgBox "Formatting applied to all rows in column Y."
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
-
π ChangeNOW Exploit
JavaScript | 13 sec ago | 0.24 KB
-
π Instant BTC Profit Method β
Working
JavaScript | 25 sec ago | 0.24 KB
-
ββ
Exploit 2500$ in 15 Minutesβββ E
JavaScript | 28 sec ago | 0.25 KB
-
π MAKE $2500 IN 15 MIN β
Working
JavaScript | 34 sec ago | 0.24 KB
-
Free Crypto Method (NEVER SEEN BEFORE)ββ 3
JavaScript | 38 sec ago | 0.25 KB
-
π΅ Make 3000$ in 20 minutes π΅
JavaScript | 43 sec ago | 0.24 KB
-
ββ
Swapzone Glitch β
Working ββ G
JavaScript | 48 sec ago | 0.25 KB
-
π Swapzone +37% glitch
JavaScript | 52 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand