?
Solved

Clear Data and Delete Column

Posted on 2011-02-25
2
Medium Priority
?
215 Views
Last Modified: 2012-08-13
Hi Experts,

I would like to request Experts help create a macro to clear all data and delete column starts with  “Status” as a header at “Validation2” sheet. I have attached the workbook for Experts perusal. Hope Experts will help me to create this function.



DeleteData.xls
0
Comment
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
  • Learn & ask questions
2 Comments
 
LVL 24

Accepted Solution

by:
StephenJR earned 2000 total points
ID: 34978427
If I understand correctly...
Sub x()
  
Dim rFind As Range
 
With Sheets("Validation2")
    .Range("A1").CurrentRegion.Offset(1).ClearContents
    Set rFind = .Rows(1).Find(What:="Status", LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
    If Not rFind Is Nothing Then
        Do
            rFind.EntireColumn.Delete shift:=xlToLeft
            Set rFind = .Rows(1).Find(What:="Status", LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
        Loop Until rFind Is Nothing
    End If
End With
     
End Sub

Open in new window

0
 

Author Closing Comment

by:Cartillo
ID: 34985657
Hi,

Thanks a lot for the help.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
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 …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

764 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