Msmithson,
It does not matter what columns the following headings are in RNotes RNotes, as long as they are in row 1, then the macro will move the data per your request.
Detach/open workbook FindMoveData - Msmithson - EF768723 - SDG12.xls and run macro FindMoveData.
To test the macro in another workbook:
Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
2. Open your workbook
3. Press the keys ALT + F11 to open the Visual Basic Editor
4. Press the keys ALT + I to activate the Insert menu
5. Press M to insert a Standard Module
6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
7. Press the keys ALT + Q to exit the Editor, and return to Excel
8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Option Explicit
Sub FindMoveData()
' stanleydgromjr, 03/17/2011
' http://www.excelforum.com/excel-programming/768723-macro-to-move-data-into-another-column.html
Dim LR As Long, a As Long, RN As Long, GN As Long
Application.ScreenUpdating = False
RN = Application.Match("RNotes", Rows(1), 0)
GN = Application.Match("GNotes", Rows(1), 0)
LR = Cells(Rows.Count, RN).End(xlUp).Row
For a = 2 To LR Step 1
Cells(a, RN).Value = Cells(a, RN).Value & " " & Cells(a, GN).Value
Next a
Range(Cells(2, GN), Cells(LR, GN)).ClearContents
Columns(RN).AutoFit
Application.ScreenUpdating = True
End Sub
Then run the FindMoveData macro.
Bookmarks