Please tell me how, using cells , to determine if the cell is merged with another. In fact, I need to unload the names of the rows into the form (in the ComboBox), but these names refer to several rows at once (that is, the cells are merged vertically).

    1 answer 1

    The task is not completely clear. Check if the cell is merged with another (s):

     If Worksheets("Лист1").Cells(1, 3).MergeCells Then MsgBox "Таки да!" 

    When merging, the value of the cells, except the left top, is lost. In this case, to create a list for the ComboBox, it is not necessary to check whether the cells are merged; it is enough to check the cells for the presence of data. The code that creates the list of the form element:

     Private Sub UserForm_Initialize() Dim Rng As Range Dim n ' создать выпадающий список With Worksheets("Лист1") Set Rng = .Range("C1:H4") ' присвоить переменной диапазон "шапки" таблицы End With ' цикл по ячейкам For Each n In Rng.Value If n <> "" Then ' если в ячейке есть данные Me.ComboBox1.AddItem n ' добавить строку в список End If Next n End Sub 

    PS In the calculation tables, try not to merge cells if possible, there may be problems with calculations.