Solved

Cut and Paste Data

Posted on 2011-09-14
5
267 Views
Last Modified: 2012-06-21
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
Comment
Question by:Cartillo
  • 2
  • 2
5 Comments
 
LVL 12

Assisted Solution

by:viralypatel
viralypatel earned 50 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

by:Cartillo
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

by:
SANTABABY earned 450 total points
ID: 36537552
Please try the following macro:

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

Open in new window

0
 
LVL 10

Expert Comment

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

Open in new window


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

Author Closing Comment

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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
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…

770 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