I am getting an error on RemoveItem. How to solve?
Also despite having 2 columns, there is only one showing up. How to display the item # in column 1, keeping the item in Column 2?
Private Sub ListBox1_Initialize()
Dim Mylist(81, 2) As String ' List of Merged Cells after Set Up (manual or automatic) is over
Dim i As Long
Mylist(0, 0) = "Line"
Mylist(0, 1) = "Column BA"
For i = 1 To 81
Mylist(i, 0) = "#" & FormatNumber(i, 0) ' number of insertion of Merged Cells
Mylist(i, 1) = "BA" & FormatNumber(i, 0) ' Where the Merged Cells addresses are located
Next i
ListBox1.ColumnCount = 2
ListBox1.List = Mylist
End Sub
'+++++++++++++++++++++++++++++++++++++++++++++++ When User clicks on one item in the list, then the value listed will do µnmerge in the Main Grid +++++++++++++++++++++++++++++++++++
Private Sub ListBox1_Click()
Range("AI49").Value = UserForm4.ListBox1.Value
Analyze_Which_to_UnMerge ' unMerge the selected item stored in AI49, it will also reduce A45 by one
Range("A45") = Range("A45") + 1
UserForm4.ListBox1.RemoveItem Range("A45").Value
Range("A45") = Range("A45") - 1
End Sub
Bookmarks