Solved

Cut and Paste Data

Posted on 2011-09-14
5
246 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Hi SANTABABY,
Thanks a lot for helping me.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
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…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

771 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

10 Experts available now in Live!

Get 1:1 Help Now