我沒見過這種情況,你要提問最好貼一段代碼出來。

解决方案 »

  1.   

    我沒見過這種情況,你把你的代碼寫來看看吧
      

  2.   

    For i = 0 To MSHFlexGrid1.Rows - 1
            MSHFlexGrid1.Row = i
            For j = 0 To MSHFlexGrid1.Cols - 1
                MSHFlexGrid1.Col = j
                If IsNull(MSHFlexGrid1.Text) = False Then
                    xlSheet.Cells(i + 3, j + 1) = MSHFlexGrid1.Text
                End If
            Next j
        Next i
        
        '---------------------------------
        With xlSheet
            .Range(.Cells(3, 1), .Cells(MSHFlexGrid1.Rows + 2, 14)).BorderAround LineStyle:=xlContinuous, Weight:=xlHairline
            .Range(.Cells(3, 1), .Cells(MSHFlexGrid1.Rows + 2, 14)).Borders(xlInsideHorizontal).LineStyle = xlContinuous
            .Range(.Cells(3, 1), .Cells(MSHFlexGrid1.Rows + 2, 14)).Borders(xlInsideHorizontal).Weight = xlHairline
            .Range(.Cells(3, 1), .Cells(MSHFlexGrid1.Rows + 2, 14)).Borders(xlInsideVertical).LineStyle = xlContinuous
            .Range(.Cells(3, 1), .Cells(MSHFlexGrid1.Rows + 2, 14)).Borders(xlInsideVertical).Weight = xlHairline
        End With
        xx = "a" & 3
        yy = "b" & 4
        xlSheet.Range(xx & ":" & yy).MergeCells = True
        xlSheet.Range("a5:a8").MergeCells = True
    '    Dim strRange As String
    '    strRange = "A5:A8"
    '    xlSheet.Range(strRange).Merge
    '    xlSheet.Range(strRange).HorizontalAlignment = xlCenter
    '    xlSheet.Range(strRange).VerticalAlignment = xlCenter
        xlSheet.Range("a9:a12").MergeCells = True
        xlSheet.Range("a13:a16").MergeCells = True
        xlSheet.Range("a17:a20").MergeCells = True
    就是上述代码.希望你们看过之后,给与答案.我在线等候.