根据环境渲染css(rendering css by environment)
我期待切换到asp.net mvc网站上的webpack,并有3个不同的网站环境,每个环境都有自己的配色方案(所以人们知道他们在什么环境),所以我需要一种方式来告诉webpack哪些CSS文件加载和何时,但不知道如何去做。
最终的结果是:
/asset/styles/style.dev.css
/asset/styles/style.debug.css
/asset/styles/style.prod.css
I'm looking to switch to webpack on an asp.net mvc website and there's 3 different environments of this website and each environment has their own color scheme (so people know what environment they're on) so I need a way to tell webpack which css file to load and when, but not sure how to go about that.
the end result is:
/asset/styles/style.dev.css
/asset/styles/style.debug.css
/asset/styles/style.prod.css
原文:https://stackoverflow.com/questions/50882518
最满意答案
尝试这个:
Sub Formatter() Dim All_Data As Range Dim Response As Range Dim MyCell As Range Dim MyCell2 As Range Set All_Data = Range("All_Data") Set Response = Range("Response") For Each MyCell In All_Data If MyCell.Value = "Decommission" Then MyCell.Interior.ColorIndex = 3 For Each MyCell2 In Intersect(Response, ActiveSheet.Rows(MyCell.Row)) If MyCell2.Value = "Yes" Then MyCell2.Interior.ColorIndex = 4 End If Next End If Next End Sub
Try this:
Sub Formatter() Dim All_Data As Range Dim Response As Range Dim MyCell As Range Dim MyCell2 As Range Set All_Data = Range("All_Data") Set Response = Range("Response") For Each MyCell In All_Data If MyCell.Value = "Decommission" Then MyCell.Interior.ColorIndex = 3 For Each MyCell2 In Intersect(Response, ActiveSheet.Rows(MyCell.Row)) If MyCell2.Value = "Yes" Then MyCell2.Interior.ColorIndex = 4 End If Next End If Next End Sub
相关问答
更多-
删除行时应该向后循环。 For i = lastRow to 2 Step -1 'Step --1 tells VBA to loop in reverse 'MsgBox (Cells(i, 1) & " " & Cells(i, 1).Interior.ColorIndex) If Worksheets("Export Worksheet").Cells(i, 1).Interior.ColorIndex <> "4" Then 'MsgBox ("Row " & i & " ...
-
尝试这个 Option Explicit Sub Fill_Cell() Dim rngCell As Range For Each rngCell In Range("C7:K100") If rngCell.Value = "0" Then Select Case Cells(rngCell.row, "L") Case Is = "" rngCell.Cells.Interior.ColorIndex = 3 ...
-
限定对象并避免选择 Sub ActualColouring() Dim ws as Worksheet Set ws = ThisWorkbook.Worksheets("mySheet") ' change name as needed With ws Dim SerialNumber As Long, lRow as Long lRow = .Range("A" & .Rows.Count).End(xlup).Row For SerialNumber = 2 to lR ...
-
不确定这是否正是您想要的,但它会让您关闭: Sub summary() Dim sh1 As Worksheet, sh2 As Worksheet Dim N As Long, i As Long, r1 As Range, r2 As Range Dim z As Long Dim arr() As Variant z = 1 Set sh1 = ActiveSheet With ActiveWorkbook Set sh2 = . ...
-
第一次试图帮助这里的人,所以我希望我做对了! 尝试添加 Application.Volatile 到你的代码下面你的变量声明。 这使Excel在执行其标准重算时重新计算您的功能。 但是,如果你使用你的UDF很多,事情会变慢。 如果您没有禁用autocalc,则在逐步执行代码时也会变成巨大的痛苦。 希望这可以帮助。 First time trying to help someone on here, so I hope I'm doing it right!! Try adding Application.V ...
-
尝试这个 : Sub Merge_Priority() Dim RgToMerge As String For i = 1 To ActiveSheet.Cells(Rows.Count, 4).End(xlUp).Row RgToMerge = "" If LCase(Cells(i, 4)) <> "update" Or (LCase(Cells(i + 1, 4)) <> "new" And Cells(i + 1, 4) <> "") Then Else ...
-
尝试这个: Sub Formatter() Dim All_Data As Range Dim Response As Range Dim MyCell As Range Dim MyCell2 As Range Set All_Data = Range("All_Data") Set Response = Range("Response") For Each MyCell In All_Data If MyCell.Value = "Decommission" Then MyCell.Int ...
-
Excel 2003的VBA公式,用于根据字体颜色粘贴特殊值(VBA formula for Excel 2003 to paste special values based on font color)[2023-07-14]
只需做一些事情并用宏录制器录制它们并查看结果,就可以完成所有这些操作。 这不是你应该怎么做的,而是一个简单的例子 Sub setPurpleValues() Dim myStr As String For Each cell In Range("A2:Z100") If cell.Font.ColorIndex = 13 Then myStr = cell.Value Else myStr = "No" 'MsgBox (myStr) If myStr <> "No" Then cell. ... -
Excel VBA根据单元格颜色隐藏行,如果命令显示“是”(Excel VBA Hide Rows based on cell color and if command says “Yes”)[2022-08-09]
您可以在任何模块代码窗格中尝试此代码: Sub HideRows() Dim beginRow As Long, endRow As Long, chkCol As Long, chkCommCol As Long, rowCnt As Long beginRow = 1 endRow = cells(Rows.Count, 1).End(xlUp).Row '<--| set 'endRow' to column A last not empty cell row index ... -
使用Excel-VBA时,掌握Objects和Collections的概念以及如何循环它们是非常有帮助的。 Watch窗口是您最好的朋友,编写代码时With关键字也是如此。 在您的情况下: Cell是Worksheet.Cells -collection中的一个对象(在您的情况下,也是ActiveSheet.Rows(1).Cells内的对象。 这可以根据你给我们的信息做你想要的(你没有指定你不想循环整行;)) Option Explicit Sub ColorCells() Dim objCel ...