» Merge cells without loosing values using VBA in Microsoft Excel
CATEGORY - General Topics in VBA
VERSION - All Microsoft Excel Versions
The cells from column A and B are to be merged without losing the values from column B
Answer:
Insert the following code in the appropriate modules.
Place the code below into the standard module
Sub Connects()
Dim intRow As Integer
Dim txt As String
intRow = 1
Do Until IsEmpty(Cells(intRow, 1))
Cells(intRow, 1) = Cells(intRow, 1) & " - " & Cells(intRow, 2)
Cells(intRow, 2).ClearContents
Range(Cells(intRow, 1), Cells(intRow, 2)).Merge
intRow = intRow + 1
Loop
Columns(1).AutoFit
End Sub
Book Store:
Recommended Books:
- The Essential 55: An Award-Winning Educator's Rules for Discovering the Successful Student in Every Child
- Investing in Real Estate, Fourth Edition
- Financial Statement Analysis with S&P insert card
- Preparing the Marketing Plan (Ama Marketing Toolbox Series New Edition)
- Cashflow Quadrant: Rich Dad's Guide to Financial Freedom
- Special Edition Using Microsoft Outlook 2002
No comments have been submitted.

