Solved

Cut and Paste Data

Posted on 2011-09-14
5
258 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
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…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

930 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

9 Experts available now in Live!

Get 1:1 Help Now