Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Cut and Paste Data

Posted on 2011-09-14
Medium Priority
291 Views
Hi Experts,

I would like to request Experts help create a macro to cut and paste all data that were stars with "F00" at column B 1 cell up. E.g. Data at cell B56 need cut and paste it at cell C55. Same goes data at cell B79 moved to cell B78.

Hope Experts will help me create this feature. Attached the workbook for Experts perusal.
Cut-Copy-Data.xls
0
Question by:Cartillo
[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
• 2
• 2

LVL 12

Assisted Solution

viralypatel earned 200 total points
ID: 36536509
A simple formula pasted in all cells of the column does the job. You dont need a macro. Check the changes in the attached files. Cut-Copy-Data.xls
0

Author Comment

ID: 36536931
Hi viralypatel,

Sorry if my question was not very clearly defined where should cut and paste the data. The data need to be pasted at the same column but 1 cell up. All other columns are actually with data, I simply remove it since it's not relevant to the question.
0

LVL 10

Accepted Solution

SANTABABY earned 1800 total points
ID: 36537552

``````Sub CutCopy()
Dim max As Long

max = Range("B65536").End(xlUp).Row

For i = 1 To max
If Left(Cells(i, 2).Value, 3) = "F00" Then
Cells(i - 1, 3).Value = Cells(i, 2).Value
Cells(i, 2).Clear
End If
Next i

End Sub
``````
0

LVL 10

Expert Comment

ID: 36537576
Correction:
Start the loop from second row:
``````For i = 2 To max
``````

because, there is no destination cell(i.e. C0),  if B1 satisfies your criteria.
0

Author Closing Comment

ID: 36540119
Hi SANTABABY,
Thanks a lot for helping me.
0

## Featured Post

Question has a verified solution.

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

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
###### Suggested Courses
Course of the Month5 days, 16 hours left to enroll