Solved

find and move cell

Posted on 2014-03-28
2
260 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
Comment Utility
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
Comment Utility
please post an example workbook with the before and after state of row data you are describing.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now