Solved

# find and move cell

Posted on 2014-03-28
265 Views
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
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

LVL 12

Accepted Solution

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
``````
0

LVL 45

Expert Comment

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

## Featured Post

Question has a verified solution.

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

### Suggested Solutions

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
###### Suggested Courses
Course of the Month5 days, 11 hours left to enroll