Solved

find and move cell

Posted on 2014-03-28
2
264 Views
Last Modified: 2014-03-31
Can an expert help me out with this please.

This is a CSV file with the data in Column A. When I find Grp1 I want to move that row to column B

AMXXX0002 (111) CHTY      HTWW-AMPHLETT SCHLR(WXXX)
Grp1       5860.0000           0.00           0.00       0.00                         0.00         666.90

So if
AMXXX0002 (111) CHTY      HTWW-AMPHLETT SCHLR(WXXX)
is in A3

and Grp1       5860.0000           0.00           0.00       0.00                         0.00         666.90
is in A4 , move
Grp1       5860.0000           0.00           0.00       0.00                         0.00         666.90

to B3

Thanks
0
Comment
Question by:Jagwarman
2 Comments
 
LVL 12

Accepted Solution

by:
Harry Lee earned 500 total points
ID: 39962056
Jagwarman,

You can use this vba to do it.

Sub FormatCSVReportv1()
Dim I As Long, LastRW As Long


LastRW = Cells(Rows.Count, 1).End(xlUp).Row
For I = 1 To LastRW
    If Cells(I, 1) Like "*Grp1*" Then
        Cells(I - 1, 2) = Cells(I, 1)
    End If
Next

For I = LastRW To 1 Step -1
    If Cells(I, 1) Like "*Grp1*" Then
        Cells(I, 1).EntireRow.Delete Shift = UP
    End If
Next
End Sub

Open in new window

0
 
LVL 45

Expert Comment

by:aikimark
ID: 39962116
please post an example workbook with the before and after state of row data you are describing.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question