Hey guys I have been working on some code to concatenate 2 columns with data into another column. I want to be able to have a macro that is tied to a button that when I press the button it automatically concatenates 2 specific columns(Must be able to specify which columns in the code) into another specified column. For example, I would like to have a macro that concatenates column C2+M2 and gives me the values of that into O2. I'm kind of new to Excel programming and trying to learn how to use it for work purposes. I currently have a macro set up that does something similar but it is not set for specific columns, it only has a starting column, which will then concatenate the column to the right and give me the values into the following column if that makes sense. Here is the code I have so far:
Sub concatecells()
Dim scell As Range
Set scell = Range("C2") '<==set start cell here.
Dim os As Double: os = 0
Do Until scell.Offset(os, 0) = ""
scell.Offset(os, 2).Value = scell.Offset(os, 0).Value & " " & scell.Offset(os, 1).Value
os = os + 1
Loop
End Sub
Any help would be greatly appreciated.
Bookmarks