excel - Merge cells using vba based on a value -


In my Excel spreadsheet, I have the column X from X with the following values:

  JKLMNOPQRSTUVWX 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3   

Where values ​​are themselves variable and can change. For example the values ​​can be:

  JKLMNOPQRSTUVWX 1 2 2 2 2 2 2 3 3 3 3 3 3 3   

I try to write I am doing a vba which will merge all the cells (right) with the values ​​of 1, 2, 3, etc. Any help would be appreciated. For example, the result would be 1: The column would be merged as J 1 through N. The column O will be merged as 2 through U X will merge into call V 3. See below

  JOV 1 2 3   

Thanks.

I got a reply from somewhere else. As the range set rngMerge = Range ("J5: X5"), I will leave it here

  Application.ScreenUpdating = False application.DisplayAlerts = False dim rngMarge range form Set the boundary limit in 'MergeAgain' here: in cell for each cell in rngMerge if cell.Value = cell.Offset (0, 1). Price and isEmpty (cell) = Unreal again range (cell, cell. Offset (0, 1)). If you have answered your question about the questions given below, please see the following questions:     

. If anyone is interested screen = updating = False application.DisplayAlerts = False dim rngMerge range, set the cell as a range set rngMerge = Range ("J5: X5") Set the boundaries here MergeAgain: For each cell in RngMerge if cell.Value = cell.Offset (0, 1). Value and isEmpty (cell) = false again range (cell, cell. Offset (0, 1)) merge goto mergence and if next

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -