|  

» Combine column text and replace using VBA in Microsoft Excel

Question:
Text from column C:D is to be combined and column D to be reset


Answer:
Insert the following code in the standard module.







Sub Edit()
Dim intRow As Integer, intRowL As Integer
Application.ScreenUpdating = False
intRowL = Cells(Rows.Count, 3).End(xlUp).Row
For intRow = 2 To intRowL
Cells(intRow, 3) = Cells(intRow, 3) & " - " & Cells(intRow, 4)
Next intRow
Range(Cells(2, 4), Cells(intRowL, 4)).Value = "489-610"
Columns.AutoFit
Application.ScreenUpdating = True
End Sub



Rate This Tip
12 34 5
Rating: 2.40     Views: 21018
No comments have been submitted.
Click here to post comment
For Registered Users
Name
Comment Title
Comments