Solved

find and move cell

Posted on 2014-03-28
2
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 46

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

615 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