Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel ime增益如果我要升级,到目前为止,我的代码在一台相当好的计算机上大约需要1mn30,而且我的用户必须经常使用宏,这在时间上不是非常令人印象深刻…有罪,我是制作模板的人!对于复选框,我得到了一个控制区域,其中复选框的值链接在一起(真/假),只是输出格式不能_Excel_Vba - Fatal编程技术网

Excel ime增益如果我要升级,到目前为止,我的代码在一台相当好的计算机上大约需要1mn30,而且我的用户必须经常使用宏,这在时间上不是非常令人印象深刻…有罪,我是制作模板的人!对于复选框,我得到了一个控制区域,其中复选框的值链接在一起(真/假),只是输出格式不能

Excel ime增益如果我要升级,到目前为止,我的代码在一台相当好的计算机上大约需要1mn30,而且我的用户必须经常使用宏,这在时间上不是非常令人印象深刻…有罪,我是制作模板的人!对于复选框,我得到了一个控制区域,其中复选框的值链接在一起(真/假),只是输出格式不能,excel,vba,Excel,Vba,ime增益如果我要升级,到目前为止,我的代码在一台相当好的计算机上大约需要1mn30,而且我的用户必须经常使用宏,这在时间上不是非常令人印象深刻…有罪,我是制作模板的人!对于复选框,我得到了一个控制区域,其中复选框的值链接在一起(真/假),只是输出格式不能只打开这些值。当某个内容为false或空白时,它总是在摘要上输出“-”,但当某个内容为true时,它必须输出不同的字符串工作簿中有三种类型的数据:包含用户填写的文本或数字的单元格、复选框和带文本的下拉列表。答案与我给出的Retiredgeek相


ime增益如果我要升级,到目前为止,我的代码在一台相当好的计算机上大约需要1mn30,而且我的用户必须经常使用宏,这在时间上不是非常令人印象深刻…有罪,我是制作模板的人!对于复选框,我得到了一个控制区域,其中复选框的值链接在一起(真/假),只是输出格式不能只打开这些值。当某个内容为false或空白时,它总是在摘要上输出“-”,但当某个内容为true时,它必须输出不同的字符串工作簿中有三种类型的数据:包含用户填写的文本或数字的单元格、复选框和带文本的下拉列表。答案与我给出的Retiredgeek相同,你的看起来也很简单和优雅,但我不知道该在哪里粘贴,我相信我在任何地方都试过了,但没能成功,你能指出吗?我想我在Iw=Iw+1,EndConsolidation之前、之间和之后都试过了,下一步是没有可用的代码可以使用,但我仍然有兴趣找出为什么我不能让你的代码发挥作用,如果不介意,请将以下行添加到代码的开头:Dim counter As Integer Dim previousRowBlank As Boolean counter=0 previousRowBlank=True。。在Iw=Iw+1之前添加其余代码
Sub SummaryMacro()
Dim Sh As Worksheet
Range("B2:L1000").ClearContents
Iw = 2  ' Index Write
For Each Sh In ActiveWorkbook.Sheets
    If Sh.Name = "Summary" Then GoTo EndConsolidation
    Cells(Iw, 1).Select
With Selection
    .Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="'" & Sh.Name & "'" & "!" & "A1", TextToDisplay:="Go to"
End With
    Cells(Iw, 2) = Sh.Name
    If Sh.Range("D8") = "" Then
    Cells(Iw, 3) = "-"
    Else
    Cells(Iw, 3) = Sh.Range("D8")
    End If
    
   'Here the rest of the process (Iw, 4 till Iw, 125)
   'The process also includes a few variations:
   
   'Something like 20 of those with various text
   If Sh.CheckBoxes("Check Box 1").Value = 1 Then Cells(Iw, 40) = "Declared" Else Cells(Iw, 40) = "-"  
   
   'Something like 30 of those with various text
    If Sh.Range("H33") = "Issued" Then
    Cells(Iw, 42) = "-"
   Else
   Cells(Iw, 42) = Sh.Range("H33")
   End If
    
    'But all in all they are mostly like that
    If Sh.Range("C134") = "" Then
    Cells(Iw, 126) = "-"
    Else
    Cells(Iw, 126) = Sh.Range("C134")
    End If
   
    Iw = Iw + 1
EndConsolidation:
Next Sh

End Sub
If Not WorksheetFunction.Concat(Range("D8"), Range("C134"), etc) Like "*#*" Then
'Code here to skip this and remaining sheets.
Sub SummaryMacro()
Const REQUIRED_CELLS_ADDRESS As String = "D8,...<all other source cells>...,B6"
Const SUM_SHEETNAME As String = "Summary"

Dim ws As Worksheet
Dim wsSum As Worksheet
Dim rCell As Range
Dim oTargetCell As Range
Dim oSumCell As Range
Dim aAddress As Variant
Dim i As Integer
    aAddress = Split(REQUIRED_CELLS_ADDRESS, ",")
    Set wsSum = ActiveWorkbook.Worksheets(SUM_SHEETNAME)
    wsSum.UsedRange.Offset(1, 0).ClearContents
    Set oTargetCell = wsSum.Range("A1")
    For Each ws In ActiveWorkbook.Worksheets
        If ws.Name <> SUM_SHEETNAME Then
            Set oTargetCell = oTargetCell.Offset(1, 0)
            wsSum.Hyperlinks.Add Anchor:=oTargetCell, Address:="", SubAddress:="'" & ws.Name & "'" & "!" & "A1", TextToDisplay:="Go to"
            oTargetCell.Resize(1, 123).Value = "-"
            Set oSumCell = oTargetCell.Offset(0, 1)
            oSumCell.Value = ws.Name
            For i = LBound(aAddress) To UBound(aAddress)
                Set rCell = ws.Range(aAddress(i))
                Set oSumCell = oSumCell.Offset(0, 1)
                If Not IsEmpty(rCell) Then oSumCell.Value2 = rCell.Value2
            Next i
        End If
    Next ws
End Sub
Sub SummaryMacro()
Const SUM_SHEETNAME As String = "Summary"
Dim ws As Worksheet
Dim wsSum As Worksheet
Dim oTargetCell As Range
Dim aResData As Variant
    aAddress = Split(REQUIRED_CELLS_ADDRESS, ",")
    Set wsSum = ActiveWorkbook.Worksheets(SUM_SHEETNAME)
    wsSum.UsedRange.Offset(1, 0).ClearContents
    Set oTargetCell = wsSum.Range("A1")
    For Each ws In ActiveWorkbook.Worksheets
        If ws.Name <> SUM_SHEETNAME Then
            Set oTargetCell = oTargetCell.Offset(1, 0)
            wsSum.Hyperlinks.Add Anchor:=oTargetCell, Address:="", SubAddress:="'" & ws.Name & "'" & "!" & "A1", TextToDisplay:="Go to " & ws.Name
            aResData = validateData(ws.Range("A1:L140").Value2) ' Or  "D8:C134" or any other
            oTargetCell.Offset(0, 1).Resize(1, UBound(aResData) + 1).Value = aResData
        End If
    Next ws
End Sub
The validateData() function is very simple and looks like this:
Function validateData(aD As Variant) As Variant
    validateData = validateValues(aD(1, 5), aD(2, 8), aD(3, 1), aD(2, 11), _
       ........ , _
       aD(111, 3), aD(112, 8), aD(123, 9), aD(126, 10))
End Function
Function validateValues(ParamArray aData() As Variant) As Variant
Dim i As Variant
Dim aResult As Variant
    ReDim aResult(LBound(aData) To UBound(aData))
    For i = LBound(aData) To UBound(aData)
        Select Case i
            Case 1, 5, 7, 9 ' Checking cells empty / value
                aResult(i) = IIf(aData(i) = "", "-", aData(i))
            Case 4, 6, 10   ' Checking cells boolean True / "not True" (False or blank)
                aResult(i) = IIf(aData(i), "Declared", "-")
            Case 0, 3, 8    ' Checking cells string "Issued" / other
                aResult(i) = IIf(aData(i) = "Issued", "-", aData(i))
            Case 2, 91, 118 ' Checking cells string "Pending" / other
                aResult(i) = IIf(aData(i) = "Issued", "-", aData(i))
            Case Else   ' In a real macro, this line is not needed, it will never be executed because all the cells of the array are already listed above, this is useful only for debugging while all conditions will be written
                aResult(i) = "-"
                Debug.Print "Cell #" & i & " not processed yet"
        End Select
    Next i
    validateValues = aResult
End Function
oTargetCell.Offset(0, 1).Resize(1, UBound(aResData) + 1).Value = aResData
   If (WorksheetFunction.CountIf(Range("D" & Iw & ":DV" & Iw), "-") = 123) Then
     Cntr = Cntr + 1  'Blank sheet found
   Else
     Cntr = 0  'Not blank - Restart counter
   End If
   
   If (Cntr = 10) Then Exit For
Dim counter As Integer
Dim previousRowBlank As Boolean
counter = 0
previousRowBlank = True

 'count if all the 123 cells contain - string
    If (WorksheetFunction.CountIf(Sheets("Summary").Range("D" & Iw & ":DV" & Iw), "-") = 123) Then
        If (counter = 0) Then
            counter = counter + 1
            previousRowBlank = True
        Else
            If (previousRowBlank = True) Then
            counter = counter + 1
            End If
        End If
    Else
        previousRowBlank = False
        counter = 0
    End If
    
    'assuming you want to exit when 10 consecutive rows are blank
    If (counter = 10) Then
        Exit Sub
    End If