English 中文(简体)
Merge and Justification a range of Rows in Excel
原标题:Merge and Left Justify a Range of Rows in Excel

我有VBA代码,选择同一牢房,然后合并和安插;这为选择提供依据。

我谨加强这一机制,以便让我选择一系列或部分的行文,并在每一行之间采取同样的行动。

问题回答

实际上,为了回答我自己的问题,我在寻求帮助时,用一些法典来发言。 没有人会看到任何问题? 除我外,还有人反对《综合框架》的声明,认为该声明不应忽视,也不应混淆任何一谈。

Sub MergeLeft()

    Dim range As range
    Dim i As Integer
    Dim RowCount As Integer

      Merge Macro
      Keyboard Shortcut: Ctrl+Shift+A

    RowCount = Selection.Rows.Count
    For i = 1 To RowCount
       Set range = Selection.Rows(i)
        If range(i) <> "" Then
       With range
          .HorizontalAlignment = xlLeft
          .VerticalAlignment = xlBottom
          .WrapText = False
          .Orientation = 0
          .AddIndent = False
          .IndentLevel = 0
          .ShrinkToFit = False
          .ReadingOrder = xlContext
          .MergeCells = False
       End With
       range.Merge
        End If
    Next i

End Sub

为什么不使用雇佣军? 其内在工具正在 drop倒。 如果你需要打扫Merge的工作方式,你也可以使用Merge(A Cross)





相关问题
import of excel in SQL imports NULL lines

I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

Excel date to Unix timestamp

Does anyone know how to convert an Excel date to a correct Unix timestamp?

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...

热门标签